Skip to content

Commit

Permalink
fix: default stream handler import
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Jan 13, 2025
1 parent 19a2278 commit 3313224
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion canaille/app/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from flask import has_request_context
from flask import request
from flask.logging import default_handler
from flask.logging import wsgi_errors_stream


class IPFilter(logging.Filter):
Expand Down Expand Up @@ -70,7 +71,7 @@ def setup_logging(app):
formatter = logging.Formatter(
"[%(asctime)s] - %(ip)s - %(levelname)s in %(module)s: %(message)s"
)
handler = logging.StreamHandler(stream="ext://flask.logging.wsgi_errors_stream")
handler = logging.StreamHandler(stream=wsgi_errors_stream)
handler.setFormatter(formatter)
app.logger.setLevel(log_level)
app.logger.removeHandler(default_handler)
Expand Down

0 comments on commit 3313224

Please sign in to comment.