Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14729

Add log component to non-debug messages

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.7.4
    • Fix Version/s: 2.7.5
    • Component/s: Logging
    • Labels:

      Description

      Currently only debug log messages are written with the log component name. It would be useful to log the component name for severities other than DEBUG(N).

      These macros should use the log component declared at the top of the file using the macro:

      #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kMyComponent

      Example:

      2014-08-12T13:05:49.142-0400 D COMMANDS [conn4] run command admin.$cmd { _isSelf: 1 }
      2014-08-12T13:05:49.142-0400 I QUERY    [conn4] command admin.$cmd command: _isSelf { _isSelf: 1 } ntoreturn:1 keyUpdates:0 numYields:0  reslen:53 0ms
      2014-08-12T13:05:49.142-0400 I REPLSETS [rsStart] replSet load config ok from benetymbp.local:31100
      2014-08-12T13:05:49.142-0400 D NETWORK  [conn4] Socket recv() conn closed? 10.4.112.255:63280
      

      A secondary goal would be to disallow the use of mongo/util/log.h in headers.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              benety.goh Benety Goh
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: