default log sets to json

This commit is contained in:
2026-07-17 04:53:50 +00:00
parent 35d8bf9b02
commit 258e0fcf6e
+1 -1
View File
@@ -33,7 +33,7 @@ from bgfilter.service import SEG_MODELS, PipelineManager
# Per-request correlation id. A middleware sets it; a logging filter injects it into
# every record so all logs for one request share the id. contextvars (not thread-
# locals) so a pooled worker thread never inherits the previous request's id.
LOG_FORMAT = os.environ.get("BGFILTER_LOG_FORMAT", "text").strip().lower()
LOG_FORMAT = os.environ.get("BGFILTER_LOG_FORMAT", "json").strip().lower()
_request_id_var: contextvars.ContextVar[str] = contextvars.ContextVar("request_id", default="-")
_RID_RE = re.compile(r"^[A-Za-z0-9._-]{1,64}$")