From 2db9850a76b80939926f0358baec47dca50cb3dc Mon Sep 17 00:00:00 2001 From: albertkun Date: Mon, 12 Feb 2024 12:33:42 -0800 Subject: [PATCH] refactor: log level to ERROR for Logzio handlers --- fastapi/app/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fastapi/app/main.py b/fastapi/app/main.py index 4408112..8cdb2ec 100644 --- a/fastapi/app/main.py +++ b/fastapi/app/main.py @@ -1018,16 +1018,17 @@ def setup_logging(): uvicorn_error_logger = logging.getLogger("uvicorn.error") logger = logging.getLogger("uvicorn.app") logzio_formatter = logging.Formatter("%(message)s") + logzio_uvicorn_access_handler = LogzioHandler(Config.LOGZIO_TOKEN, 'uvicorn.access', 5, Config.LOGZIO_URL) - logzio_uvicorn_access_handler.setLevel(logging.WARNING) + logzio_uvicorn_access_handler.setLevel(logging.ERROR) # Set level to ERROR logzio_uvicorn_access_handler.setFormatter(logzio_formatter) logzio_uvicorn_error_handler = LogzioHandler(Config.LOGZIO_TOKEN, 'uvicorn.error', 5, Config.LOGZIO_URL) - logzio_uvicorn_error_handler.setLevel(logging.WARNING) + logzio_uvicorn_error_handler.setLevel(logging.ERROR) # Set level to ERROR logzio_uvicorn_error_handler.setFormatter(logzio_formatter) logzio_app_handler = LogzioHandler(Config.LOGZIO_TOKEN, 'fastapi.app', 5, Config.LOGZIO_URL) - logzio_app_handler.setLevel(logging.WARNING) + logzio_app_handler.setLevel(logging.ERROR) # Set level to ERROR logzio_app_handler.setFormatter(logzio_formatter) uvicorn_access_logger.addHandler(logzio_uvicorn_access_handler)