From 3643f3a435f64d83bd748d245e90ae1d41c6c296 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sun, 5 Jun 2022 14:37:52 +0300 Subject: [PATCH] WIP: sql_app: Logger config (Broken state) Signed-off-by: HeshamTB --- sql_app/logger_config.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql_app/logger_config.py diff --git a/sql_app/logger_config.py b/sql_app/logger_config.py new file mode 100644 index 0000000..2f91b28 --- /dev/null +++ b/sql_app/logger_config.py @@ -0,0 +1,26 @@ + +log_config = { + "version": 1, + "disable_existing_loggers": False, + "formatters": { + "access": { + "()": "uvicorn.logging.AccessFormatter", + "fmt": '%(levelprefix)s %(asctime)s :: %(client_addr)s - "%(request_line)s" %(status_code)s', + "use_colors": True + }, + }, + "handlers": { + "access": { + "formatter": "access", + "class": "logging.StreamHandler", + "stream": "ext://sys.stdout", + }, + }, + "loggers": { + "uvicorn.access": { + "handlers": ["access"], + "level": "INFO", + "propagate": False + }, + }, +} \ No newline at end of file