Skip to content

Structured Logging

Eduard Mishkurov edited this page May 3, 2026 · 3 revisions

Structured Logging

logme writes logs in a text format by default. This is the primary mode and is optimized for performance, readability and unambiguous parsing.

In addition to this, structured logging is available when it is needed.


Runtime structured output

Structured output can be enabled so that logme produces JSON or XML directly during logging.

In this mode, each message becomes a structured event that can be consumed by external systems in real time.

The output is streaming by design:

  • JSON is written as JSONL (one object per line)
  • XML is written as a sequence of fragments

This allows logs to be processed incrementally without waiting for a complete document.


Post-processing with logmefmt

Existing logs can also be converted using the logmefmt tool.

This is useful when you need a finalized JSON or XML document for analysis or export.

Unlike runtime output, this produces a complete and valid document.


When to use which approach

Runtime structured output is suitable when logs are consumed immediately, for example by log collectors or monitoring systems.

Post-processing is more appropriate when working with already recorded logs or when a complete document is required.


Summary

Text logging remains the default and most common mode.

Structured logging is an extension that can be enabled when needed, either at runtime or through post-processing.

Clone this wiki locally