[SERVER-38904] Long log lines truncate to less than maxLogSizeKB Created: 09/Jan/19  Updated: 27/Oct/23  Resolved: 17/Mar/20

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

Type: Improvement Priority: Minor - P4
Reporter: Kevin Pulo Assignee: DO NOT USE - Backlog - Dev Tools
Resolution: Gone away Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Developer Tools
Sprint: Sharding 2019-02-11, Sharding 2019-02-25, Sharding 2019-03-11, Sharding 2019-03-25
Participants:

 Description   

When log lines exceed maxLogSizeKB (10 KB by default), the truncation retains only the first third of maxLogSizeKB and last third of maxLogSizeKB chars of the log message.

This causes the resulting log line to be less than maxLogSizeKB (even though the value of maxLogSizeKB is reported in the line itself, in a way which suggests it has been truncated to this length), which is unexpected. For example, for the default value (10 KB), only about 7 KB is retained from a 10.5 KB log line, whereas a 9.5 KB log line will retain all its info (no truncation). Users might be surprised if they configure a custom value for maxLogSizeKB and then subsequently discover that less information has been retained.

Probably the maxLogLine / 3 occurrences should be replaced by (maxLogLine - length_of_truncation_warning) / 2 (the length of the truncation warning is about 100 bytes). Presumably the ~50 bytes for the timestamp, severity, component, and context, is not worth incorporating in the truncation length (since this is more about truncating the actual message, not necessarily the entire line).


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