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 <leonardo.borda@canonical.com>
This commit is contained in:
Leonardo Borda 2016-03-09 11:03:34 -05:00
parent cee6aceb0f
commit 6ac015b6d3
3 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,5 @@
# icehouse # icehouse
[loggers] [loggers]
keys=root keys=root
@ -14,7 +15,7 @@ level={{ root_level }}
{% else -%} {% else -%}
level=WARNING level=WARNING
{% endif -%} {% endif -%}
handlers=file handlers=file,production
[handler_production] [handler_production]
class=handlers.SysLogHandler class=handlers.SysLogHandler
@ -24,7 +25,7 @@ level={{ log_level }}
level=ERROR level=ERROR
{% endif -%} {% endif -%}
formatter=normal_with_name formatter=normal_with_name
args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) args=(('/dev/log'), handlers.SysLogHandler.LOG_USER)
[handler_file] [handler_file]
class=FileHandler class=FileHandler

View File

@ -14,7 +14,7 @@ level={{ root_level }}
{% else -%} {% else -%}
level=WARNING level=WARNING
{% endif -%} {% endif -%}
handlers=file handlers=file,production
[handler_production] [handler_production]
class=handlers.SysLogHandler class=handlers.SysLogHandler
@ -24,7 +24,7 @@ level={{ log_level }}
level=ERROR level=ERROR
{% endif -%} {% endif -%}
formatter=normal_with_name formatter=normal_with_name
args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) args=(('/dev/log'), handlers.SysLogHandler.LOG_USER)
[handler_file] [handler_file]
class=FileHandler class=FileHandler

View File

@ -587,7 +587,7 @@ class KeystoneBasicDeployment(OpenStackAmuletDeployment):
expected = { expected = {
'logger_root': { 'logger_root': {
'level': 'WARNING', 'level': 'WARNING',
'handlers': 'file', 'handlers': 'file,production',
}, },
'handlers': { 'handlers': {
'keys': 'production,file,devel' 'keys': 'production,file,devel'