-
Type: Task
-
Resolution: Done
-
Priority: 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.
- is related to
-
SERVER-14415 log component hierarchy
- Closed
-
SERVER-14416 support use of BSON configuring severity levels in the log component hierarchy
- Closed
-
SERVER-4217 add log severity and component name to the log message
- Closed
- related to
-
SERVER-5092 Better named logging with tracing
- Closed
-
SERVER-14729 Add log component to non-debug messages
- Closed
- links to