[SERVER-7140] Print same information that prints on startup when the log is rotated Created: 24/Sep/12  Updated: 11/Jul/16  Resolved: 08/Oct/13

Status: Closed
Project: Core Server
Component/s: Diagnostics, Logging
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Kyle Erf
Resolution: Done Votes: 15
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-5709 Print startup info again at top of fi... Closed
is duplicated by SERVER-8032 When logs are rotated add to beginnin... Closed
is duplicated by SERVER-8268 include build info and git version in... Closed
is duplicated by SERVER-9169 Upon log rotation, log some startup i... Closed
Related
is related to SERVER-18986 When increasing logLevel above 0, log... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

When getting a full log for analysis, if the server's been running for a long time so you just get the logs from the last day or two, and the logs are rotated each night, you don't get the startup message with info like mongodb version and startup options. Would be helpful for debugging if that information printed at the top of every log file when the logRotate command is called.



 Comments   
Comment by auto [ 03/Oct/13 ]

Author:

{u'username': u'3rf', u'name': u'Kyle Erf', u'email': u'erf@mongodb.com'}

Message: SERVER-7140 startup info is now printed on log rotate

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/1475a45bf38637670170fff57823ee1aa8a193df

Comment by Matt Kangas [ 27/Aug/13 ]

Eliot's feedback:

  • Should use the same method as startup. No more, no less.
  • Log the message hourly AND on rotate
Comment by Thomas Rueckstiess [ 15/Aug/13 ]

It should print such a line not just on log rotation but ideally every hour. That way we know that if we get >1h of log, we have all the information needed to diagnose problems.

Maybe something like this line:

2013-07-20T16:05:30.879Z [uptimeStatus] mongod version 2.5.2-pre- (9bf70757db09b3a7166440c508bf798d50bd212a) running since 2013-07-19 03:46:17.879 [UTC-5] (36.7 hours) on prod-01.example.com:27017

Things that should be included in this line:

  • binary (mongos/mongod)
  • version
  • git hash
  • uptime since
  • timezone (if mongod runs with ctime instead of the new iso8601 formats, this would otherwise not be available)
  • ip address, hostname and port
Generated at Thu Feb 08 03:13:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.