diff --git a/mapadroid/utils/logging.py b/mapadroid/utils/logging.py index 0bdcc9de6..013a8998b 100644 --- a/mapadroid/utils/logging.py +++ b/mapadroid/utils/logging.py @@ -295,7 +295,14 @@ def __init__(self, *args, **kwargs): def emit(self, record): with logger.contextualize(identifier=self.log_identifier): - logger.opt(depth=6, exception=record.exc_info).log("DEBUG5", record.getMessage()) + level = record.levelno + # Downgrade anything INFO and lower to DEBUG5 to match legacy behavior. + # Werkzeug is a bit too chatty at INFO level for it to be useful. + if level <= logging.INFO: + level = "DEBUG5" + else: + level = logging.getLevelName(level) + logger.opt(depth=6, exception=record.exc_info).log(level, record.getMessage()) # this is being used to change log level for gevent/Flask/Werkzeug