[Core][Logging] Add built-in JSON formatter (#58739)

Add `--logging-config.formatter=json` to enable the python-json-logger
formatter without having to use a complete Python logging dictConfig.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
Mark McLoughlin
2026-10-01 09:11:46 +01:00
committed by GitHub
co-authored by OpenAI Codex
parent c4fc3c7d32
commit 91fcec1235
11 changed files with 148 additions and 46 deletions
+4
View File
@@ -4,6 +4,10 @@
import logging
from pathlib import Path
JSON_FORMAT = (
"%(asctime)s %(levelname)s %(name)s %(processName)s %(process)d %(message)s"
)
class NewLineFormatter(logging.Formatter):
"""Adds logging prefix to newlines to align multi-line messages."""