mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 15:58:45 -03:30
add some exception handling for dealing with logging connection resets
when rsyslogd restarts due to config changes, there's a brief moment where the socket will refuse connections on teardown; exception handling is needed here to deal with that
This commit is contained in:
committed by
Christian Adams
parent
1000dc10fb
commit
b0db2b7bec
@@ -18,7 +18,14 @@ class RSysLogHandler(logging.handlers.SysLogHandler):
|
||||
return
|
||||
if not os.path.exists(settings.LOGGING['handlers']['external_logger']['address']):
|
||||
return
|
||||
return super(RSysLogHandler, self).emit(msg)
|
||||
try:
|
||||
return super(RSysLogHandler, self).emit(msg)
|
||||
except ConnectionRefusedError:
|
||||
# rsyslogd has gone to lunch; this generally means that it's just
|
||||
# been restarted (due to a configuration change)
|
||||
# unfortunately, we can't log that because...rsyslogd is down (and
|
||||
# would just us back ddown this code path)
|
||||
pass
|
||||
|
||||
|
||||
ColorHandler = logging.StreamHandler
|
||||
|
||||
Reference in New Issue
Block a user