From 314d3b7a853779fa88e7223021b05896f63105f2 Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Tue, 4 Sep 2012 15:34:47 +0200 Subject: [PATCH] Fall back to UDP if /dev/log does not exist. If /dev/log does not exist, swift.common.utils.get_logger would fail as it only handles the situation where /dev/log isn't a socket. Fixes bug 1045820 Change-Id: I2c33e0fa7f88f03d5b0495779832ed4de7c496da --- swift/common/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swift/common/utils.py b/swift/common/utils.py index f9765ee4a3..0249bc661b 100644 --- a/swift/common/utils.py +++ b/swift/common/utils.py @@ -604,7 +604,8 @@ def get_logger(conf, name=None, log_to_console=False, log_route=None, try: handler = SysLogHandler(address=log_address, facility=facility) except socket.error, e: - if e.errno != errno.ENOTSOCK: # Socket operation on non-socket + # Either /dev/log isn't a UNIX socket or it does not exist at all + if e.errno not in [errno.ENOTSOCK, errno.ENOENT]: raise e handler = SysLogHandler(facility=facility) handler.setFormatter(formatter)