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

guide for log messages and debug levels

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server 2.7.5, Server 2.7.6

      Provide guidelines on log message style and assigning appropriate debug log levels (LOG() macro).

      Debug Logging Enhancements:
      https://docs.google.com/a/10gen.com/document/d/1Ab2j_jpr9wjS1fS3n3fVpC3PiFPW8HiSvjHhG8rkWjc/edit?usp=sharing

      Logging Module Spec (March 2013):
      https://wiki.10gen.com/display/10GEN/Logging+module

      Outline:

      Top of file (before platform/basic.h)
      #define MONGO_LOG_DEFAULT COMPONENT ::mongo::logger::LogComponent::kSharding

      Always include mongo/util/log.h where logging is done.

      No more logging in headers

      • mongo/util/log.h has been modified to prevent multiple inclusion (indirectly disallowing its use in headers)

      severe(), error(), warning(), log() and LOG() will use log component defined in MONGO_LOG_COMPONENT_DEFAULT is available. Otherwise defaults to LogComponent::kDefault.

      severe(), error(), warning(), log() will accept optional log component argument if MONGO_LOG_COMPONENT is not appropriate for the current scope.

      For configuration, see mongo db manual for logComponentVerbosity server parameter or systemLog.component YAML configuration option.

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

              Created:
              Updated:
              Resolved: