misc: force lasso messages to be considered as debug level (#74014)
gitea/docbow/pipeline/head This commit looks good
Details
gitea/docbow/pipeline/head This commit looks good
Details
This commit is contained in:
parent
77cc736a18
commit
8ba4e8a8f4
|
@ -0,0 +1,8 @@
|
|||
import logging
|
||||
|
||||
|
||||
class ForceDebugFilter(logging.Filter):
|
||||
def filter(self, record):
|
||||
record.levelno = logging.DEBUG
|
||||
record.levelname = 'DEBUG'
|
||||
return super().filter(record)
|
|
@ -154,6 +154,11 @@ STATICFILES_FINDERS = (
|
|||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': True,
|
||||
'filters': {
|
||||
'force_debug': {
|
||||
'()': 'docbow_project.docbow.logger.ForceDebugFilter',
|
||||
},
|
||||
},
|
||||
'formatters': {
|
||||
'syslog': {
|
||||
'format': PROJECT_NAME + '(pid=%(process)d) %(levelname)s %(name)s: %(message)s',
|
||||
|
@ -198,6 +203,16 @@ LOGGING = {
|
|||
'handlers': ['syslog'],
|
||||
'level': 'INFO',
|
||||
},
|
||||
# lasso has the bad habit of logging everything as errors
|
||||
'Lasso': {
|
||||
'filters': ['force_debug'],
|
||||
},
|
||||
'libxml2': {
|
||||
'filters': ['force_debug'],
|
||||
},
|
||||
'libxmlsec': {
|
||||
'filters': ['force_debug'],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -209,7 +224,7 @@ if DEBUG:
|
|||
HELP_DIR = '/usr/share/doc/docbow/help'
|
||||
|
||||
for logger in LOGGING['loggers'].values():
|
||||
if 'syslog' in logger['handlers']:
|
||||
if 'syslog' in logger.get('handlers', []):
|
||||
logger['handlers'].append('mail_admins')
|
||||
|
||||
if DEBUG and not globals()['SECRET_KEY']:
|
||||
|
|
Loading…
Reference in New Issue