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

Disabling unnesesary fields in output

Open coolerUA opened this issue 2 years ago • 0 comments

Is it possible to disable some fields in output natively? F.e. {"written_at": "2023-08-02T09:31:58.988Z", "written_ts": 1690968718988650000, "msg": "", "type": "log", "logger": "logger", "thread": "MainThread", "level": "INFO", "module": "send_log", "line_no": 107, "caller": "<module>", "info": "Starting scheduler", "correlation_id": "6db89aa2-3117-11ee-8c6e-a53ec76ddbeb"} I don`t need "written_ts" in output.

Initialization is

logger = logging.getLogger("logger") logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler(sys.stdout)) json_logging.init_flask(enable_json=True) json_logging.init_request_instrument(app, exclude_url_patterns=[r'/health', r'/metrics'])

coolerUA avatar Aug 02 '23 09:08 coolerUA