[SERVER-63142] Add log file rotation status to start of new log Created: 31/Jan/22  Updated: 29/Oct/23  Resolved: 28/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Adam Rayner Assignee: Warren James
Resolution: Fixed Votes: 0
Labels: former-quick-wins, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Security 2022-09-05, Security 2022-09-19, Security 2022-10-03
Participants:

 Description   

After a log file rotates, the new running log outputs some basic server status at the start, e.g. featureCompatibilityVersion, Build Info, Operating System, PID, etc.

We should add the log rotation status of the previously-rotated log to this collection of "header" data in the new log file, so that any issues with rotating the previous log do not depend on access to the rotated log file. For example:

1. Log rotation status (success / failure)
2. Absolute path to rotated log file (example: target=/tmp/mongo-log-rotator-suite-267013706/mongo-log-rotator_audit.log.2022-01-19T17-50-55)
3. Any minor error messages (more useful with recent improvements in log rotation error messages)



 Comments   
Comment by Githook User [ 28/Sep/22 ]

Author:

{'name': 'Warren James', 'email': 'warren.james@mongodb.com', 'username': 'W-A-James'}

Message: SERVER-63142 Add todo comment to keep track of ticket progress

SERVER-63142 Start audit::logRotateLog implementation

SERVER-63142 Start implementation of logRotateLog

SERVER-63142 Got preliminary changes for logging rotations done (WIP)

SERVER-63142 Add logic to prevent extraneous logRotate audit events from being fired

SERVER-63142 Remove TODO comment

SERVER-63142 Update signature of logRotateLog and how it is called

SERVER-63142 Use shortened namespace

SERVER-63142 Fully capture errors in logRotateLog

SERVER-63142 Use string data literals

SERVER-63142 Formatting

SERVER-63142 Append array instead of object

SERVER-63142 Add additional startup tests for audit::logRotateLog

SERVER-63142 Make log rotation BSON object generation more efficient

SERVER-63142 Add comment to test

SERVER-63142 Add check for client connection

SERVER-63142 Updated JS tests

SERVER-63142 Clang format

SERVER-63142 Test for audit log fields
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/b91da4110ce5a129ebaf79124dbb78f2cd929f20

Comment by Warren James [ 27/Sep/22 ]

Waiting in commit queue

Comment by Githook User [ 27/Sep/22 ]

Author:

{'name': 'Warren James', 'email': 'warren.james@mongodb.com', 'username': 'W-A-James'}

Message: SERVER-63142 Add log file rotation status to start of new log
Branch: master
https://github.com/mongodb/mongo/commit/d9396d167a6ceb8f43b0b9ac017e562c89bc236a

Generated at Thu Feb 08 05:56:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.