Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-17358

Add flag to customize maxLogLine when logging large lines

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.14
    • Affects Version/s: None
    • Component/s: Logging
    • Labels:
      None
    • Fully Compatible
    • Platforms 2016-09-19, Platforms 2016-10-10

      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
      

            Assignee:
            waley.chen Waley Chen
            Reporter:
            tredman@fb.com Travis Redman
            Votes:
            1 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: