Kernel logging

  • Basic Rules
    • cout/cerr should never be used
  • Normal Logging
    • debugging with levels of verbosity. default=0 (use just log() for that). See -v command line option.
      • LOG( int x ) << ...
    • informational
      • log() << ...
    • rate limited
      • LOGSOME() << ...
    • warnings
      • recoverable
      • e.g. replica set node down
      • warning()
    • errors
      • unexpected system state (disk full)
      • internal code errors
      • error()
  • Debugging Helpers
    • PRINT( x ) = prints expression text and value (can also do PRINT(x.method()))
    • PRINTFL = prints file and line (good for tracing execution)
    • printStackTrace() = shows a stack trace. Alternative to using a debugger.
    • GEODEBUG, etc... = used for incredibly verbose logging for a section of code that has to be turned on at compile time

Follow @mongodb

MongoDB Pittsburgh - May 15
MongoNYC - May 23
MongoDB Paris - Jun 14
MongoDB UK - Jun 20
MongoDC - June 26


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.

blog comments powered by Disqus