OPTIONS

Server Logging Rules

Basic Rules

  • cout/cerr should never be used
  • Include log.h to use the LOG() helper macro

Normal Logging

  • Debugging with levels of verbosity. See the -v command line option (default level is 0). If the global log level is less than x, 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() << ...