Merge "proxy-logging: Be able to configure log_route"

This commit is contained in:
Zuul 2020-08-20 04:59:23 +00:00 committed by Gerrit Code Review
commit a4f2252e2b
2 changed files with 7 additions and 2 deletions

View File

@ -887,6 +887,10 @@ use = egg:swift#proxy_logging
# access_log_level = INFO
# access_log_address = /dev/log
#
# Log route for this filter. Useful if you want to have different configs for
# the two proxy-logging filters.
# access_log_route = proxy-server
#
# If set, access_log_udp_host will override access_log_address
# access_log_udp_host =
# access_log_udp_port = 514

View File

@ -129,8 +129,9 @@ class ProxyLoggingMiddleware(object):
value = conf.get('access_' + key, conf.get(key, None))
if value:
access_log_conf[key] = value
self.access_logger = logger or get_logger(access_log_conf,
log_route='proxy-access')
self.access_logger = logger or get_logger(
access_log_conf,
log_route=conf.get('access_log_route', 'proxy-access'))
self.access_logger.set_statsd_prefix('proxy-server')
self.reveal_sensitive_prefix = int(
conf.get('reveal_sensitive_prefix', 16))