Commit 2b3e93d2 authored by Jérome Perrin's avatar Jérome Perrin

proxy: don't set app logger level

logging is configured globally in SlapOSApp.configure_logging and:
 - if logging to file is enabled, it is logged with maximum level
 - logging on the console depends on --quiet / --verbose command line flags

Default log level of this logger was DEBUG, which is just fine: the logger
emit all messages and the file/console handler decide to output them or not

Because we configure logger after Flask initialize its own logging, for
Flask >= 1.1.2, we remove Flask logger as described in
 https://flask.palletsprojects.com/en/1.1.x/logging/#removing-the-default-handler
parent 46be04e0
......@@ -102,7 +102,14 @@ def connectDB():
def do_proxy(conf):
for handler in conf.logger.handlers:
app.logger.addHandler(handler)
app.logger.setLevel(logging.INFO)
try:
# for Flask >= 1.1.2
from flask.logging import default_handler
app.logger.removeHandler(default_handler)
except ImportError:
pass
setupFlaskConfiguration(conf)
connectDB()
app.run(host=conf.host, port=int(conf.port), threaded=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment