From 35af3cd7d1e76af902b9e22b9357d0c4b50e4655 Mon Sep 17 00:00:00 2001 From: Gautier P Date: Mon, 6 Nov 2023 04:15:41 +0100 Subject: [PATCH] Never use root logger to allow filtering zappa logs with greater ease (#1277) Co-authored-by: Gautier Pelloux Co-authored-by: javulticat <31746850+javulticat@users.noreply.github.com> --- zappa/handler.py | 2 +- zappa/wsgi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zappa/handler.py b/zappa/handler.py index c1a7ff5e6..7287e09f7 100644 --- a/zappa/handler.py +++ b/zappa/handler.py @@ -30,7 +30,7 @@ # Set up logging logging.basicConfig() -logger = logging.getLogger() +logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) diff --git a/zappa/wsgi.py b/zappa/wsgi.py index 9f3051f04..f40407f62 100644 --- a/zappa/wsgi.py +++ b/zappa/wsgi.py @@ -168,7 +168,7 @@ def common_log(environ, response, response_time: Optional[int] = None): response_time: response time in micro-seconds """ - logger = logging.getLogger() + logger = logging.getLogger(__name__) if response_time: formatter = ApacheNCSAFormatter(with_response_time=True)