Logging to syslog not working

asked 2013-01-30 10:12:15 -0500

jesse-pretorius gravatar image

I want keystone to log to syslog, but it only seems to be sending log information to the log file instead. I figure that this may have something to do with the way the log handling is configured, but I can't figure out what I'm missing or doing wrong. Can someone please assist?

Extract of /etc/keystone/keystone.conf:

[DEFAULT] verbose = True debug = True log_config = /etc/keystone/logging.conf use_syslog = True syslog_log_facility = LOG_USER

Full content of /etc/keystone/logging.conf: [loggers] keys=root,keystone,combined

[formatters] keys=normal,normal_with_name,debug

[handlers] keys=production,file,devel

[logger_root] level=DEBUG handlers=file

[logger_keystone] level=DEBUG handlers=file qualname=keystone

[logger_combined] level=DEBUG handlers=file qualname=keystone-combined

[handler_production] class=handlers.SysLogHandler level=DEBUG formatter=normal_with_name #args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) args=(('', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)

[handler_file] class=FileHandler level=DEBUG formatter=normal_with_name args=('/var/log/keystone/keystone.log', 'w')

[handler_devel] class=StreamHandler level=DEBUG formatter=debug args=(sys.stdout,)

[formatter_normal] format=%(asctime)s %(levelname)s %(message)s

[formatter_normal_with_name] format=(%(name)s): %(asctime)s %(levelname)s %(message)s

[formatter_debug] format=(%(name)s): %(asctime)s %(levelname)s %(module)s %(funcName)s %(message)s

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2013-01-30 12:19:53 -0500

jesse-pretorius gravatar image

In /etc/keystone/logging.conf I changed logger_keystone to have handlers=production and now it's working.

edit flag offensive delete link more

answered 2013-01-30 11:48:26 -0500

The settings look to be ok, since LOG_USER should be a syslog facility. What settings do you have in your syslog conf, e.g. /etc/rsyslog.d/*.conf or /etc/syslog.conf etc.

You should have a line user.* /var/log/keystone.log - along those lines

edit flag offensive delete link more

answered 2013-01-30 12:01:12 -0500

jesse-pretorius gravatar image

/etc/rsyslog.conf contains the following to allow any process on the box to send to its listening address via UDP: $ModLoad imudp $UDPServerAddress $UDPServerRun 514 $AllowedSender UDP,

/etc/rsyslog.d/50-default.conf contains the following to log locally: .;auth,authpriv.none -/var/log/syslog user.* -/var/log/user.log

/etc/rsyslog.d/remote.conf sends all syslog facility logs to a remote server: . @

I don't think that this has anything to do with the syslog configuration - glance is configured to log to syslog and is working. Glance's config does not have a log_config parameter though, and that's the only difference I'm seeing here.

In /etc/keystone/logging.conf reference is made to the handlers (production,file,devel) and loggers (root,keystone,combined). All loggers are referring to the 'file' handler, and none to the 'production' handler which is what refers to syslog. I suspect that this is the issue but I cannot find a sample configuration where it shows me how to change this successfully.

Which of the loggers (root,keystone,combined) do I need to change? Is the logger determined by the userid that the service runs under, or some other means? I've dug around - even in the python logger documentation but I can't make head or tail of this yet.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-01-30 10:12:15 -0500

Seen: 454 times

Last updated: Jan 30 '13