[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: |
|
||||||||||||
| 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 ] |
|
|
| 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. |