-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Server Logging Rules (obsolete)
Louis Williams edited this page Jul 7, 2022
·
3 revisions
This document is largely obsolete. Please refer to docs/logging.md for up-to-date guidance on logging.
-
cout
/cerr
should never be used -
Include mongo/util/log.h to use the
LOG()
helper macro -
Declare a log component before the first
#include
statement in a.cpp
file to assign a default log component to log messages.#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage #include ...
-
Debugging with levels of verbosity. See the
-v
command line option (default level is 0). If the global log level is less thanx
, no functions in the stream are executed.LOG( int x ) << ...
-
Informational
log() << ...
-
Warnings
- recoverable, e.g. replica set node down
warning() << ...
-
Errors
- unexpected system state (disk full)
- internal code errors
error() << ...
Getting started
Building
Testing
- Running Tests
- Writing Tests
- Writing Function-level Benchmarks
- Writing JavaScript Integration-level Performance Tests
- Running Bisect
- Running Minimized Jstestfuzz Tests
- Testing with Antithesis
Testing in Evergreen
Code Style
Server Internals