1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-10 08:55:02 +00:00

fix LOGGING_IGNORE_MODULES ()

* fix LOGGING_IGNORE_MODULES

* Add default handler when used custom LOGGING
This commit is contained in:
欢乐马 2025-03-05 17:03:25 +08:00 committed by GitHub
parent df4e04d427
commit 2912a422bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1137,6 +1137,16 @@ else:
load_local_settings(seahub_settings)
del seahub_settings
# Add default handler when used custom LOGGING
if 'default' not in LOGGING['handlers']:
LOGGING['handlers']['default'] = {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'seahub.log'),
'maxBytes': 1024*1024*100, # 100 MB
'backupCount': 5,
'formatter': 'standard',
}
# Ignore logs of component in INFO level, and set it to ERROR level
for module in LOGGING_IGNORE_MODULES:
if module not in LOGGING['loggers']: