journald handler doesn't output user identity to metadata

Bug #1718935 reported by Juan Antonio Osorio Robles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.log
Triaged
Undecided
Unassigned

Bug Description

Even though the user_identity is set in the log message, the 'project_name', 'project_id', 'user_name' and 'user_id' are not set in the journald metadata as advertised by the handler; only the request_id is set. This is a sample record output:

Fri 2017-09-22 11:26:14.506314 UTC [s=bf4abb74b860497fa733bc2e3f5b880f;i=54c5;b=dc4374ea37dd40eaa23a96568df75479;m=25e84349f;t=559c57a0abe3f;x=5a5ea4cb4ee08d03]
    CODE_FILE=/usr/lib/python2.7/site-packages/keystone/common/wsgi.py
    CODE_LINE=222
    CODE_FUNC=__call__
    THREAD_NAME=MainThread
    PROCESS_NAME=MainProcess
    SYSLOG_IDENTIFIER=keystone-admin
    PRIORITY=6
    LOGGER_NAME=keystone.common.wsgi
    LOGGER_LEVEL=INFO
    _TRANSPORT=journal
    _UID=42425
    _GID=42425
    _COMM=httpd
    _EXE=/usr/sbin/httpd
    _CMDLINE=keystone-admin -DFOREGROUND -DFOREGROUND
    _CAP_EFFECTIVE=0
    _SYSTEMD_CGROUP=/system.slice/docker-7a8e07336dd6c64236a90bb862dab20c18dc5f72d89d1a076d0141d4b9d77f4a.scope
    _SYSTEMD_UNIT=docker-7a8e07336dd6c64236a90bb862dab20c18dc5f72d89d1a076d0141d4b9d77f4a.scope
    _SYSTEMD_SLICE=system.slice
    _SELINUX_CONTEXT=system_u:system_r:kernel_t:s0
    _BOOT_ID=dc4374ea37dd40eaa23a96568df75479
    _MACHINE_ID=843a49a9e27b4d4da7afb689ca033296
    _HOSTNAME=overcloud-controller-0
    _PID=398867
    MESSAGE=2017-09-22 11:26:14.505 17 INFO keystone.common.wsgi [req-c4a79e5d-b313-49d1-86c5-f716bc94a29e - - - - -] GET http://overcloud-controller-0.ctlplane.localdomain/v3/
    REQUEST_ID=req-c4a79e5d-b313-49d1-86c5-f716bc94a29e
    _SOURCE_REALTIME_TIMESTAMP=1506079574506314

It would be great if that data would be set in the metadata, as well as the user and project domains.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

I'm not really familiar with journald. Are there fields built into its structure for that sort of info? Or should we add it to another field, like the message?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (master)

Fix proposed to branch: master
Review: https://review.openstack.org/507375

Changed in oslo.log:
assignee: nobody → Juan Antonio Osorio Robles (juan-osorio-robles)
status: New → In Progress
Revision history for this message
Juan Antonio Osorio Robles (juan-osorio-robles) wrote :

There is extra info that one can set. And actually, oslo.log's handler already has code to set that information, it's just never filled into the record.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.log (master)

Change abandoned by Juan Antonio Osorio Robles (<email address hidden>) on branch: master
Review: https://review.openstack.org/507375

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

I'm not sure why the patch in #4 was abandoned, but if someone else wants to pick this up I think we'd be happy to have all of the journald metadata filled in.

Changed in oslo.log:
status: In Progress → Triaged
assignee: Juan Antonio Osorio Robles (juan-osorio-robles) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.