default log sets to json
This commit is contained in:
@@ -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}$")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user