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

Improve support for structured logging in signal handlers

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The current story around logging within signal handlers is not very ergonomic from either the developer's or the debugger's perspective. There isn't a good way to produce log messages that leverage the strengths of structured logging. The logging that occurs in signal handlers has to use malloc-free tooling to avoid allocating memory during signal handlers, which is dangerous as documented in SERVER-82658. We don't have any support on top of that malloc-free tooling to build JSON objects and emit them as fields. Rather, we only have the coarse-grained support for setting the message field as a string. This results in awkward constructions, like emitting a JSON-like object, stringified, in the message field.

      Revisit the logging support in the signal handling code, and see if we can add support for emitting log statements with structured contents.

            Assignee:
            Unassigned Unassigned
            Reporter:
            james.bronsted@mongodb.com James Bronsted
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None