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

Saverio Proto saverio.proto at switch.ch
Fri Jan 12 08:17:55 UTC 2018


> 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





-- 
SWITCH
Saverio Proto, Peta Solutions
Werdstrasse 2, P.O. Box, 8021 Zurich, Switzerland
phone +41 44 268 15 15, direct +41 44 268 1573
saverio.proto at switch.ch, http://www.switch.ch

http://www.switch.ch/stories



More information about the OpenStack-dev mailing list