[SERVER-17358] Add flag to customize maxLogLine when logging large lines Created: 23/Feb/15  Updated: 15/May/18  Resolved: 20/Sep/16

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

Type: New Feature Priority: Major - P3
Reporter: Travis Redman Assignee: Waley Chen
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-8981 Add flag to customize maxLogLine when... Closed
is documented by DOCS-10493 Document setParameter maxLogSizeKB Closed
Duplicate
is duplicated by SERVER-14339 Option to not truncate long log messages Closed
Related
is related to SERVER-30387 maxLogSizeKB parameter should only be... Closed
is related to SERVER-30386 Rename maxLogSizeKB parameter to maxL... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2016-09-19, Platforms 2016-10-10
Participants:

 Description   

The logger truncates log messages larger than 10k by printing the first ~3k bytes and last ~3k bytes and printing a "........" in the center. This limit seems arbitrary and would be useful if we could override it. We have customers submitting very large queries (huge $in: [] clauses for example) and although not ideal, the query contents are useful to us. The ellipses often break our query parser when doing log analysis.

It looks like a simple enough change - we would just need to switch maxLogLine from a const to some flag-driven value.
https://github.com/mongodb/mongo/blob/master/src/mongo/logger/message_event_utf8_encoder.cpp#L71

Mon Feb 23 21:39:07.519 [conn5324624] warning: log line attempted (19k) over max size (10k), printing beginning and end ... query



 Comments   
Comment by Kevin Pulo [ 06/Jul/17 ]

The added parameter is called maxLogSizeKB.

Comment by Githook User [ 20/Sep/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-17358 Add flag to customize maxLogLine when logging large lines
Branch: master
https://github.com/mongodb/mongo/commit/afdca9e2978e55b29a2b01e4cad55c794afca65e

Comment by Githook User [ 19/Sep/16 ]

Author:

{u'username': u'judahschvimer', u'name': u'Judah Schvimer', u'email': u'judah@mongodb.com'}

Message: Revert "SERVER-17358 Add flag to customize maxLogLine when logging large lines"

This reverts commit 7c6c92e3cd514a156a49ae9e5139ea66d324c004.
Branch: master
https://github.com/mongodb/mongo/commit/fe8c8614f53338eac07f4f32addc0b2eb3bdd544

Comment by Githook User [ 19/Sep/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-17358 Add flag to customize maxLogLine when logging large lines
Branch: master
https://github.com/mongodb/mongo/commit/7c6c92e3cd514a156a49ae9e5139ea66d324c004

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