aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'gn2/wqflask')
-rw-r--r--gn2/wqflask/__init__.py2
-rw-r--r--gn2/wqflask/app_errors.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/gn2/wqflask/__init__.py b/gn2/wqflask/__init__.py
index f85454ba..3744db50 100644
--- a/gn2/wqflask/__init__.py
+++ b/gn2/wqflask/__init__.py
@@ -70,7 +70,7 @@ def parse_ssl_key(app: Flask, keyconfig: str):
def dev_loggers(appl: Flask) -> None:
"""Default development logging."""
formatter = logging.Formatter(
- fmt="[%(asctime)s] %(levelname)s in %(module)s: %(message)s")
+ fmt="[%(asctime)s] %(levelname)s [%(thread)d -- %(threadName)s] in %(module)s: %(message)s")
stderr_handler = logging.StreamHandler(stream=sys.stderr)
stderr_handler.setFormatter(formatter)
appl.logger.addHandler(stderr_handler)
diff --git a/gn2/wqflask/app_errors.py b/gn2/wqflask/app_errors.py
index 5b85bd53..7c07fde6 100644
--- a/gn2/wqflask/app_errors.py
+++ b/gn2/wqflask/app_errors.py
@@ -51,6 +51,7 @@ def handle_invalid_token_error(exc: InvalidTokenError):
flash("An invalid session token was detected. "
"You have been logged out of the system.",
"alert-danger")
+ current_app.logger.error("Invalit token detected. %s", request.url, exc_info=True)
session.clear_session_info()
return redirect("/")
@@ -71,6 +72,7 @@ def handle_oauth_error(exc: OAuthError):
flash((f"{type(exc).__name__}: {__build_message__(exc)} "
"Please log in again to continue."),
"alert-danger")
+ current_app.logger.error("Invalit token detected. %s", request.url, exc_info=True)
session.clear_session_info()
return redirect("/")