Skip to content

Commit

Permalink
Never use root logger to allow filtering zappa logs with greater ease
Browse files Browse the repository at this point in the history
  • Loading branch information
Gautier Pelloux committed Oct 18, 2023
1 parent 8d68b54 commit 9d6d86d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zappa/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# Set up logging
logging.basicConfig()
logger = logging.getLogger()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)


Expand Down
2 changes: 1 addition & 1 deletion zappa/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9d6d86d

Please sign in to comment.