[SERVER-10084] Logging infrastructure improvements for auditing Created: 02/Jul/13  Updated: 02/Aug/18  Resolved: 22/Jul/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5.1

Type: Task Priority: Major - P3
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-9239 Mongo Server does not close stdout wh... Closed
Related
related to SERVER-14112 logging cleanup: kill logflush() Closed
related to SERVER-14116 logging cleanup: Remove out() and _log() Closed
is related to SERVER-33758 Remove logUserIds Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Refactor and reimplement the logging system so that more of it is available for re-use for the DDL auditing project.



 Comments   
Comment by auto [ 10/Jul/13 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-10084 When --logpath is specified and --logappend is not, rotate away preexisting log files.

This fixes jstests/slowNightly/logpath.js, and brings behavior in line with prior versions.
Branch: master
https://github.com/mongodb/mongo/commit/61c4b0358b61b4cf4630999f45ca34d0cafd4a66

Comment by auto [ 10/Jul/13 ]

Author:

{u'name': u'Andrew Schwerin', u'email': u'Andy Schwerin schwerin@10gen.com'}

Message: SERVER-10084 Make LogstreamBuilder safe to use during static init; fix memory leak.

Fixes mongo/logger/log_test unit test on OS X.
Branch: master
https://github.com/mongodb/mongo/commit/81c207c0c5160d02dc8fe752ec662f943c0ee10d

Comment by Andy Schwerin [ 10/Jul/13 ]

Breaks jstests/slowNightly/logpath.js. When mongo servers are started with --logpath=X, and X exists, they should first rename X to X.(-date-and-time), as though it had been rotated out of the way.

http://buildlogs.mongodb.org/Linux%2064-bit%20DUR%20OFF/builds/2580/test/recent%20failures/logpath.js

Comment by auto [ 10/Jul/13 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-10084 Fix build errors from logging caused by implicit construction of SockAddr.
Branch: master
https://github.com/mongodb/mongo/commit/86774c4091d3286b4ee2281402c67fba440e23c8

Comment by auto [ 09/Jul/13 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-10084 New logging implementation.

This change-set:

  • Introduces a new top-level directory, mongo/logger, containing most of the implementation of logging functionality formerly found in log.cpp/log.h.
  • Cleans up existing, unusual uses of the logging system that were not trivially compatible with the new implementation.
  • Replaces Logstream/Nulstream with a LogstreamBuilder object, whose destructor writes log messages. This new LogstreamBuilder is reentrant, unlike the old logging code, which was thread-safe but not reentrant. Additionally, std::endl is no longer required to terminate a log line. When a LogstreamBuilder goes out of scope, the log message gets committed.
  • Separates the log system into several components: a global LogManager, several LogDomains, various kinds of Appenders (e.g., SyslogAppender) and Encoders (for formatting messages).
  • Allows unit tests to capture and examine log output.

This patch does not introduce support for hierarchical log domains, or for enabling and disabling specific log domains when the server is running in a multi-threaded mode. This is future work.
Branch: master
https://github.com/mongodb/mongo/commit/ea22c3173541606519ddcb6da578b837a092b1c1

Generated at Thu Feb 08 03:22:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.