json
Returns a formatter that serializes each log event as a single-line JSON object, suitable for ingestion by log aggregation platforms such as Elasticsearch, Datadog, Splunk, and Loki.
The output is always valid, standards-compliant JSON. When showEmoji is true, the level's emoji is included as a dedicated "levelEmoji" field inside the JSON object rather than outside it, preserving validity.
Parameters
showEmoji
Whether to include a "levelEmoji" field in the JSON output.