add UDP protocol support for logger

When a syslog daemon fails and SysLogHandler cannot reconnect to
it, server processes (proxy, container, object, and more)
would start consuming 100 % CPU and stop responding to requests.
It is because the server process go into an infinite loop if they
fail to reconnect to /dev/log.
This problem happens only when using unix_sockets.

This change enables us to use syslog without unix_sockets and fixes bug 780025.

Change-Id: Ibcc99a1a148b1008036146bf3bd079a9be24982c
This commit is contained in:
Kota Tsuyuzaki
2012-06-22 04:47:52 -07:00
parent fcab7b7358
commit f0eb25a973
4 changed files with 20 additions and 9 deletions

View File

@@ -1865,7 +1865,8 @@ class BaseApplication(object):
if logger is None:
self.logger = get_logger(conf, log_route='proxy-server')
access_log_conf = {}
for key in ('log_facility', 'log_name', 'log_level'):
for key in ('log_facility', 'log_name', 'log_level',
'log_udp_host', 'log_udp_port'):
value = conf.get('access_' + key, conf.get(key, None))
if value:
access_log_conf[key] = value