Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-8981

Add flag to customize maxLogLine when logging large lines

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • Server
    • None

    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
      

      Attachments

        Activity

          People

            brian.moss@mongodb.com Brian Moss
            emily.hall Emily Hall
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 8 weeks, 5 days ago