Skip to content

Commit

Permalink
Squash #146 - add debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
MackHalliday committed Jun 26, 2024
1 parent 00e001a commit fa45e71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions notifications_utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ def after_request(response):

ensure_log_path_exists(app.config['NOTIFY_LOG_PATH'])
the_handler = get_handler(app)

loglevel = logging.getLevelName(app.config['NOTIFY_LOG_LEVEL'])
print("This is the log level", loglevel)

loggers = [app.logger, logging.getLogger('utils')]
for the_logger, handler in product(loggers, [the_handler]):
the_logger.addHandler(handler)
Expand Down Expand Up @@ -115,7 +117,9 @@ def is_200_static_log(log) -> bool:
def get_handler(app):
stream_handler = logging.StreamHandler(sys.stdout)

# stream_handler.setLevel(logging.getLevelName(app.config['NOTIFY_LOG_LEVEL']))
stream_handler.setLevel(logging.getLevelName(app.config['NOTIFY_LOG_LEVEL']))
print("THIS IS THE APPNAMEFILTER variable", logging.getLevelName(app.config['NOTIFY_LOG_LEVEL']))
stream_handler.addFilter(AppNameFilter(app.config['NOTIFY_APP_NAME']))
stream_handler.addFilter(RequestIdFilter())

Expand Down

0 comments on commit fa45e71

Please sign in to comment.