Skip to content

Commit

Permalink
fix: fix logger issue on AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
takahiromitsui committed May 4, 2024
1 parent c0edc42 commit 6ccbb4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/logging_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@


def configure_logging():
if logging.getLogger().handlers:
# The Lambda environment pre-configures a handler logging to stderr.
# If a handler is already configured, .basicConfig does not execute.
# Thus we set the level directly.
logging.getLogger().setLevel(logging.INFO)
else:
logging.basicConfig(level=logging.INFO)
logging_config = {
"version": 1,
"disable_existing_loggers": False,
Expand Down

0 comments on commit 6ccbb4d

Please sign in to comment.