[SERVER-33469] Make syslog log lines consistent with mongod log lines Created: 23/Feb/18  Updated: 29/Oct/23  Resolved: 06/Dec/18

Status: Closed
Project: Core Server
Component/s: Diagnostics, Logging
Affects Version/s: None
Fix Version/s: 3.4.19, 3.6.10, 4.0.6, 4.1.7

Type: New Feature Priority: Major - P3
Reporter: Bruce Lucas (Inactive) Assignee: Mathew Robinson (Inactive)
Resolution: Fixed Votes: 2
Labels: SWDI
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-15522 Syslog appender should summarize long... Closed
is related to SERVER-38903 Remove dead MessageEventWithContextEn... Closed
Backwards Compatibility: Minor Change
Backport Requested:
v4.0, v3.6, v3.4
Sprint: Dev Tools 2018-12-03, Dev Tools 2018-12-17
Participants:
Case:
Linked BF Score: 0

 Description   

When mongod logs to syslog each entry looks like this:

2018-02-19T18:32:16.955448+00:00 hostname mongod.27017[116540]: [conn6362] Successfully authenticated as principal mms-monitoring-agent on admin

This lacks useful information that is present in mongod log files:

  • component
  • severity
  • mongod-generated timestamp - the timestamp is generated by the syslog facility, which means
    • depending on how the customer has configured their system, it may lack millisecond precision and timezone; and may be in a difficult-to-parse, locale-dependent format
    • more significantly, it's generated by syslog on receipt of the log line, so under heavy load the syslog timestamp can differ very significantly from the time when the event occured (by tens of seconds or more), making diagnosis of events impossible

It would be helpful if the log line handed to the syslog facility was identical to the line logged in mongod log files. For example:

2018-02-19T18:32:16.955448+00:00 hostname mongod.27017[116540]: 2018-03-27T15:12:21.570-0400 I EXECUTOR [worker-controller] Target MaxQueueLatencyMicros (100μs) is less than minimum timer resolution of OS (10000000ns). Using 10000000ns

This would provide the missing information, and would make writing tools to consume log files much easier.



 Comments   
Comment by Kevin Pulo [ 09/Jan/19 ]

This change has also fixed SERVER-15522.

Comment by Githook User [ 08/Jan/19 ]

Author:

{'username': 'chasinglogic', 'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson'}

Message: SERVER-33469 Fix lint errors
Branch: v3.6
https://github.com/mongodb/mongo/commit/72eb34d72f47a8450707087b1967699240ddb715

Comment by Githook User [ 08/Jan/19 ]

Author:

{'username': 'chasinglogic', 'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson'}

Message: SERVER-33469 Fix lint errors
Branch: v3.4
https://github.com/mongodb/mongo/commit/8ce634946a837a925382c519ddacdba5dba1f3af

Comment by Githook User [ 07/Jan/19 ]

Author:

{'username': 'chasinglogic', 'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson'}

Message: SERVER-33469 Make syslog consistent with mongod log files

(cherry picked from commit 68b8f7a6ca82e0acbee5eb24cf7a24d6b563877c)
Branch: v3.4
https://github.com/mongodb/mongo/commit/c54b016d2249b25dcde5177e9ac160fefa7f4570

Comment by Githook User [ 07/Jan/19 ]

Author:

{'username': 'chasinglogic', 'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson'}

Message: SERVER-33469 Make syslog consistent with mongod log files

(cherry picked from commit 68b8f7a6ca82e0acbee5eb24cf7a24d6b563877c)
Branch: v3.6
https://github.com/mongodb/mongo/commit/6ca2a69a3e13acec637e3d3dda3a9ef7501c2a5b

Comment by Githook User [ 07/Jan/19 ]

Author:

{'username': 'chasinglogic', 'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson'}

Message: SERVER-33469 Make syslog consistent with mongod log files

(cherry picked from commit 68b8f7a6ca82e0acbee5eb24cf7a24d6b563877c)
Branch: v4.0
https://github.com/mongodb/mongo/commit/6b32504bb88a7386b6993f8a788998b60a9e314f

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}

Message: SERVER-33469 Make syslog consistent with mongod log files
Branch: master
https://github.com/mongodb/mongo/commit/68b8f7a6ca82e0acbee5eb24cf7a24d6b563877c

Generated at Thu Feb 08 04:33:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.