json-logging-python icon indicating copy to clipboard operation
json-logging-python copied to clipboard

Failed to customize Procedure

Open hanzhenbjm opened this issue 4 years ago • 2 comments

`class TestLog(json_logging.JSONLogWebFormatter): def _format_log_object(self, record, request_util):

    json_log_object = super(TestLog, self)._format_log_object(record, request_util)
    json_log_object.update({
        "message": _sanitize_log_msg(record),
        "lineno": record.lineno,
        "TraceId": request_util.get_correlation_id(within_formatter=True),
        "log_type": "desc"
    })

    return json_log_object`

use flask web framework,

Failed to customize Procedure

{"written_ts": 1630401382592000000, "thread": "Thread-2", "level": "DEBUG", "line_no": 30, "module": "main", "correlation_id": "1c030c00-0a3c-11ec-a078-aced5c5e9c18", "msg": "ok=123", "logger": "test-logger", "type": "log", "written_at": "2021-08-31T09:16:22.592Z"} There's nothing I added

hanzhenbjm avatar Aug 31 '21 09:08 hanzhenbjm

image image and What this function does (CustomDefaultRequestResponseDTO) thanks

hanzhenbjm avatar Aug 31 '21 09:08 hanzhenbjm

can u provide your full source code

bobbui avatar Aug 31 '21 17:08 bobbui

main.zip

hanzhenbjm avatar Sep 22 '21 09:09 hanzhenbjm