diff options
author | Alexandre Flament <alex@al-f.net> | 2021-09-08 08:44:40 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-09-11 10:13:16 +0200 |
commit | 6abc37efc75a472b977306e5352c10358f3a1d08 (patch) | |
tree | a32e4fd8a90620d2f4a06e98227dd51a3cdcdcd9 /searx/__init__.py | |
parent | 0e42db9da111bbf1984ae48889acee05e4dd2dd8 (diff) | |
download | searxng-6abc37efc75a472b977306e5352c10358f3a1d08.tar.gz searxng-6abc37efc75a472b977306e5352c10358f3a1d08.zip |
[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)
Diffstat (limited to 'searx/__init__.py')
-rw-r--r-- | searx/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |