[SERVER-15522] Syslog appender should summarize long log messages Created: 03/Oct/14  Updated: 09/Jan/19  Resolved: 09/Jan/19

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

Type: Improvement Priority: Minor - P4
Reporter: James O'Leary Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

*nix


Issue Links:
Depends
Related
related to SERVER-33469 Make syslog log lines consistent with... Closed
Participants:

 Description   

When logging messages to a file, MongoDB summarizes long log messages rather than truncating because the end of the message often contains valuable information, such as query execution time.

MongoDB should do the same when writing to syslog but use a maximum line length appropriate for syslog.


(Original description)

When a long line is logged, it is truncated to ensure that the logs don't bloat.

However syslog also truncates long lines and has a lower max length (1024 I believe). As a result the ms duration is missing.

This line in in 2.6 should either be configurable or should be syslog aware.



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

SERVER-33469 has addressed this (by changing the syslog appender to use MessageEventDetailsEncoder instead of MessageEventWithContextEncoder), and syslog log lines will now be truncated identically to regular log lines.

Comment by Matt Kangas [ 15/Jan/15 ]

Note that the example above never prints "warning: log line attempted (Nk) over max size". In MongoDB 2.6+, messages written to syslog are truncated by syslog only.

Syslog logging is initialized in initialize_server_global_state.cpp. It uses logger::MessageEventWithContextEncoder, which performs no message truncation.

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