From 6abc37efc75a472b977306e5352c10358f3a1d08 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 8 Sep 2021 08:44:40 +0200 Subject: [PATCH] [mod] production mode: make sure to set the log level to WARNING set: * the root logger level to WARNING * the werkzeug logger level to WARNING (useful when there is no uwsgi) --- searx/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/__init__.py b/searx/__init__.py index 12376b0fd..93ad76bb1 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -18,6 +18,7 @@ LOG_FORMAT_DEBUG = '%(levelname)-7s %(name)-30.30s: %(message)s' # Production LOG_FORMAT_PROD = '%(asctime)-15s %(levelname)s:%(name)s: %(message)s' +LOG_LEVEL_PROD = logging.WARNING searx_dir = abspath(dirname(__file__)) searx_parent_dir = abspath(dirname(dirname(__file__))) @@ -95,7 +96,9 @@ searx_debug = settings['general']['debug'] if searx_debug: logging_config_debug() else: - logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT_PROD) + logging.basicConfig(level=LOG_LEVEL_PROD, format=LOG_FORMAT_PROD) + logging.root.setLevel(level=LOG_LEVEL_PROD) + logging.getLogger('werkzeug').setLevel(level=LOG_LEVEL_PROD) logger = logging.getLogger('searx') logger.info(settings_load_message)