From 30e905782b58f4e166c4a166102ea0f7c927dcef Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 10 Apr 2024 07:49:51 +0300 Subject: Use application logger, not root logger. --- qc_app/errors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qc_app') diff --git a/qc_app/errors.py b/qc_app/errors.py index 7af7696..d7d3858 100644 --- a/qc_app/errors.py +++ b/qc_app/errors.py @@ -3,12 +3,12 @@ import logging import traceback import MySQLdb as mdb -from flask import Flask, request, render_template +from flask import Flask, request, render_template, current_app as app def handle_general_exception(exc: Exception): """Handle generic exceptions.""" trace = traceback.format_exc() - logging.error( + app.logger.error( "Error (%s.%s): Generic unhandled exception!! (URI: %s)\n%s", exc.__class__.__module__, exc.__class__.__name__, request.url, trace) return render_template("unhandled_exception.html", trace=trace) -- cgit v1.2.3