Alistair Coles c7d56fa9c5 py36: Fix syslog fallback to UDP
With py2 the SysLogHandler would raise an error if it could not
connect to the configured log_address socket. This prompted the
utils.get_logger() method to fallback to using UDP. With py3 an error
is not raised [1], so the fallback never happens. In that scenario,
exceptions are raised when swift services are started and attempt to
log.

This patch modifies get_logger() to test if the log_address is a socket
before instantiating a SysLogHandler and fallback to UDP if not a socket.

[1] https://github.com/python/cpython/blob/master/Lib/logging/handlers.py#L833-L842

Change-Id: Ic099fdc3925bf99f8528c7aa763b651c19df1322
2021-03-16 17:57:37 +00:00
..
2021-03-16 17:57:37 +00:00
2020-05-15 22:38:04 -07:00