Prevent duplicate log entries

This commit is contained in:
Brain 2022-01-26 23:19:26 +01:00
parent 1360b4c738
commit 695c88e159
Signed by untrusted user: Brain
GPG Key ID: 9CF47083EE57670D

1
app.py
View File

@ -20,6 +20,7 @@ app = Flask(__name__)
loglevel = os.getenv("KI_LOGLEVEL", logging.WARNING) loglevel = os.getenv("KI_LOGLEVEL", logging.WARNING)
loglevel = int(loglevel) loglevel = int(loglevel)
app.logger.setLevel(loglevel) app.logger.setLevel(loglevel)
app.logger.propagate = False # do not forward messages to the root logger
logging.basicConfig(level=loglevel, format='[%(asctime)s] %(levelname)s [%(name)s] %(message)s') # configure root logger as fallback logging.basicConfig(level=loglevel, format='[%(asctime)s] %(levelname)s [%(name)s] %(message)s') # configure root logger as fallback
set_library_log_detail_level(BASIC) set_library_log_detail_level(BASIC)