From 6ac015b6d3eca4f3102cf615d978f4ca9a8d551a Mon Sep 17 00:00:00 2001 From: Leonardo Borda Date: Wed, 9 Mar 2016 11:03:34 -0500 Subject: [PATCH] Fix log handlers to work for both syslog and rsyslog Update the [handler_production] and [logger_root] parameters in logging.conf in order to ensure the logs are written to the syslogd daemon. Update to use the /dev/log socket from the syslogd daemon so that the logging works for both rsyslog and syslog. Change-Id: I841f856637b9ca90b446025be6ddaadff7ae06cd Closes-Bug: #1554871 Signed-off-by: Leonardo Borda --- templates/icehouse/logging.conf | 5 +++-- templates/kilo/logging.conf | 4 ++-- tests/basic_deployment.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/templates/icehouse/logging.conf b/templates/icehouse/logging.conf index ca68b898..f84a4d73 100644 --- a/templates/icehouse/logging.conf +++ b/templates/icehouse/logging.conf @@ -1,4 +1,5 @@ # icehouse + [loggers] keys=root @@ -14,7 +15,7 @@ level={{ root_level }} {% else -%} level=WARNING {% endif -%} -handlers=file +handlers=file,production [handler_production] class=handlers.SysLogHandler @@ -24,7 +25,7 @@ level={{ log_level }} level=ERROR {% endif -%} formatter=normal_with_name -args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) +args=(('/dev/log'), handlers.SysLogHandler.LOG_USER) [handler_file] class=FileHandler diff --git a/templates/kilo/logging.conf b/templates/kilo/logging.conf index bd182fd0..f59507e7 100644 --- a/templates/kilo/logging.conf +++ b/templates/kilo/logging.conf @@ -14,7 +14,7 @@ level={{ root_level }} {% else -%} level=WARNING {% endif -%} -handlers=file +handlers=file,production [handler_production] class=handlers.SysLogHandler @@ -24,7 +24,7 @@ level={{ log_level }} level=ERROR {% endif -%} formatter=normal_with_name -args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) +args=(('/dev/log'), handlers.SysLogHandler.LOG_USER) [handler_file] class=FileHandler diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 7ba1b3c2..ca71d79e 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -587,7 +587,7 @@ class KeystoneBasicDeployment(OpenStackAmuletDeployment): expected = { 'logger_root': { 'level': 'WARNING', - 'handlers': 'file', + 'handlers': 'file,production', }, 'handlers': { 'keys': 'production,file,devel'