[openstack-dev] [oslo][oslo.log] JSON logs are missing the request ID

Doug Hellmann doug at doughellmann.com
Fri Jan 12 15:31:29 UTC 2018


Excerpts from Saverio Proto's message of 2018-01-12 09:17:55 +0100:
> > Which service's logs are missing the request_id?
> > 
> If I look at neutron-server logs with my current setup I get two files:
> 
> neutron-server.log
> neutron-server.json
> 
> the standard log file has in all neutron.wsgi lines information like:
> 
>  neutron.wsgi [req-4fda8017-50c7-40eb-9e7b-710e7fba0d01
> 97d349b9499b4bd29c5e167c65ca1fb3 d447c836b6934dfab41a03f1ff96d879 - - -]
> 
> where req-UUID is the request ID, and the other two values are the user
> UUID and the keystone project UUID.
> 
> when I look at the same line in the JSON output this information is missing.
> 
> I am starting neutron-server with the command line option
> --log-config-append=/etc/neutron/logging.neutron-server.conf
> 
> where the conf file looks like
> 
> [loggers]
> keys = root, neutron
> 
> [handlers]
> keys = logfile, jsonfile, null
> 
> [formatters]
> keys = context, json, default
> 
> [logger_root]
> level = WARNING
> handlers = null
> 
> [logger_neutron]
> level = INFO
> handlers = logfile, jsonfile
> qualname = neutron
> 
> [handler_logfile]
> class = handlers.WatchedFileHandler
> args = ('/var/log/neutron/neutron-server.log',)
> formatter = context
> 
> [handler_jsonfile]
> level = INFO
> class = handlers.WatchedFileHandler
> args = ('/var/log/neutron/neutron-server.json',)
> formatter = json
> 
> [handler_null]
> class = logging.NullHandler
> formatter = default
> args = ()
> 
> [formatter_context]
> class = oslo_log.formatters.ContextFormatter
> 
> [formatter_json]
> class = oslo_log.formatters.JSONFormatter
> 
> [formatter_default]
> format = %(message)s
> 
> 
> I had a look at nova-api and I have the same problem. Anyway in my
> Kibana I never so a req-UUID what so ever, so this looks like a problem
> with all the openstack services.
> 
> Is it a problem with my logging configuration ?
> 
> thank you
> 
> Saverio
> 

I don't think this is a configuration problem.

Which version of the oslo.log library do you have installed?

Doug



More information about the OpenStack-dev mailing list