debian: disable syslog loggers if there's no /dev/log (#36738)

This commit is contained in:
Frédéric Péters 2019-10-07 14:36:30 +02:00
parent 8471bf5e32
commit 4b6ea35bfc
1 changed files with 7 additions and 0 deletions

View File

@ -167,6 +167,13 @@ if os.path.exists('/run/systemd/journal/socket'):
LOGGING['loggers']['']['handlers'].remove('syslog')
LOGGING['loggers']['']['handlers'].append('journald')
elif not os.path.exists('/dev/log'):
# if three's no syslog (for example when building a docker image), remove
# those loggers.
LOGGING['loggers']['']['handlers'].remove('syslog')
LOGGING['loggers']['py.warnings']['handlers'].remove('syslog_no_filter')
ETC_DIR = '/etc/%s' % PROJECT_NAME
VAR_DIR = '/var/lib/%s' % PROJECT_NAME