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

Add log component to non-debug messages

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.7.5
    • 2.7.4
    • Logging

    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

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: