customization of operational log format does not work

Bug #1675176 reported by Akihiro Motoki
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Akihiro Motoki

Bug Description

OPERATION_LOG_OPTIONS['format'] can be specified in local_settings.py, but it has no effect and the default format is used.

[local_settings.py]
OPERATION_LOG_ENABLED = True
OPERATION_LOG_OPTIONS = {
    'mask_fields': ['password'],
    'target_methods': ['POST', 'GET'],
    'format': ("---------> [%(domain_name)s] [%(domain_id)s] [%(project_name)s]"
        " [%(project_id)s] [%(user_name)s] [%(user_id)s] [%(request_scheme)s]"
        " [%(referer_url)s] [%(request_url)s] [%(message)s] [%(method)s]"
        " [%(http_status)s] [%(param)s]"),
}

[Output]
2017-03-22 21:12:10,857 [None] [None] [demo] [3b91ad8c9c624303aa38334f8fc5349e] [demo] [07c9103fb1fa4a518036b9dd68838c70] [http] [/project/networks/] [/project/networks/create] [None] [POST] [200] [{"gateway_ip": "", "address_source": "subnetpool", "prefixlen": "26", "password": "********", "subnet_name": "subnet2", "csrfmiddlewaretoken": "7KmXLqudvPQHylJ7pZdByTPjb0XlTiaB", "dns_nameservers": "", "subnetpool": "08e5f334-6c24-45c0-90da-15191730298a", "ipv6_modes": "none/none", "net_name": "net2", "allocation_pools": "", "ip_version": "4", "admin_state": "True", "net_profile_id": "", "enable_dhcp": "on", "shared": "False", "cidr": "", "host_routes": "", "with_subnet": "on"}]

Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Medium
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/448798
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=fdb21222b6061c1b42298a9c7d3380a8df6e837a
Submitter: Jenkins
Branch: master

commit fdb21222b6061c1b42298a9c7d3380a8df6e837a
Author: Akihiro Motoki <email address hidden>
Date: Wed Mar 22 21:44:27 2017 +0000

    operation_log: Honor settings parameters

    Previously 'format' and 'mask_fields' in OPERATION_LOG_OPTIONS
    were completely ignored. OPERATION_LOG_OPTIONS is a dict, but
    the logic tried to get attributes, so these options were ignored.

    Change-Id: Ide4826ebf74218873a81b67aaa0dd817c4798702
    Closes-Bug: #1675176

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 12.0.0.0b1

This issue was fixed in the openstack/horizon 12.0.0.0b1 development milestone.

Revision history for this message
Mateusz Kowalski (makowals) wrote :

Hi. We just run into this in newton, is it going to be backported to stable/newton and stable/ocata or should we just carry on a local patch?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/462223

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/462224

Revision history for this message
Akihiro Motoki (amotoki) wrote :

I proposed a backport to ocata and newton.

note that newton is now in the phase of accepting only security fixes and critical fixes, so I am not sure the stable reviewers accept the backport for newton or not.

Changed in horizon:
milestone: none → pike-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/ocata)

Reviewed: https://review.openstack.org/462223
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=03aec78ae8ca387954b50683a821c49f1df9d74e
Submitter: Jenkins
Branch: stable/ocata

commit 03aec78ae8ca387954b50683a821c49f1df9d74e
Author: Akihiro Motoki <email address hidden>
Date: Wed Mar 22 21:44:27 2017 +0000

    operation_log: Honor settings parameters

    Previously 'format' and 'mask_fields' in OPERATION_LOG_OPTIONS
    were completely ignored. OPERATION_LOG_OPTIONS is a dict, but
    the logic tried to get attributes, so these options were ignored.

    Change-Id: Ide4826ebf74218873a81b67aaa0dd817c4798702
    Closes-Bug: #1675176
    (cherry picked from commit fdb21222b6061c1b42298a9c7d3380a8df6e837a)

tags: added: in-stable-ocata
tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/newton)

Reviewed: https://review.openstack.org/462224
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=bedd32243a612d82535e5d5015b8289b441a3be6
Submitter: Jenkins
Branch: stable/newton

commit bedd32243a612d82535e5d5015b8289b441a3be6
Author: Akihiro Motoki <email address hidden>
Date: Wed Mar 22 21:44:27 2017 +0000

    operation_log: Honor settings parameters

    Previously 'format' and 'mask_fields' in OPERATION_LOG_OPTIONS
    were completely ignored. OPERATION_LOG_OPTIONS is a dict, but
    the logic tried to get attributes, so these options were ignored.

    Change-Id: Ide4826ebf74218873a81b67aaa0dd817c4798702
    Closes-Bug: #1675176
    (cherry picked from commit fdb21222b6061c1b42298a9c7d3380a8df6e837a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 11.0.2

This issue was fixed in the openstack/horizon 11.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 10.0.4

This issue was fixed in the openstack/horizon 10.0.4 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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