Tweak logging of process id

Bug #1040772 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Wishlist
Stuart McLaren
OpenStack Compute (nova)
Fix Released
Wishlist
Unassigned
openstack-common
Fix Released
Undecided
Unassigned

Bug Description

I'd like to suggest tweaking how we log process id.

Currently the log looks like:

2012-08-21 12:16:36 DEBUG glance.store [-] Attempting to import store glance.store.filesystem.Store from (pid=16913) _get_store_class /usr/lib/python2.7/dist-packages/glance/store/__init__.py:146
2012-08-21 12:16:36 DEBUG glance.store [-] Registering store <class 'glance.store.filesystem.Store'> with schemes ('file', 'filesystem') from (pid=16913) create_stores /usr/lib/python2.7/dist-packages/glance/store/__init__.py:176
2012-08-21 12:16:36 DEBUG glance.store.base [-] Late loading location class glance.store.filesystem.StoreLocation from (pid=16913) get_store_location_class /usr/lib/python2.7/dist-packages/glance/store/base.py:68

I find it tricky to see if these are from the same process on the server or not.

Tweaking to be in a fixed position like:

2012-08-23 16:40:48 DEBUG 11141 glance.api.middleware.version_negotiation [-] Using url versioning process_request /usr/lib/python2.7/dist-packages/glance/api/middleware/version_negotiation.py:55
2012-08-23 16:40:48 DEBUG 11141 glance.api.middleware.version_negotiation [-] Matched version: v1 process_request /usr/lib/python2.7/dist-packages/glance/api/middleware/version_negotiation.py:67
2012-08-23 16:40:48 DEBUG 11141 glance.api.middleware.version_negotiation [-] new uri /v1/images/48fb03f5-2dfe-4a6e-8b60-8260158edb72 process_request /usr/lib/python2.7/dist-packages/glance/api/middleware/version_negotiation.py:68

makes it easier to track which requests are being handled by which processes.

Changed in glance:
assignee: nobody → Stuart McLaren (stuart-mclaren)
Changed in glance:
status: New → In Progress
Brian Waldon (bcwaldon)
Changed in glance:
importance: Undecided → Wishlist
Revision history for this message
Mark McLoughlin (markmc) wrote :

Merging into openstack-common's stable/folsom branch now https://review.openstack.org/12825

Just need to sync it from there

Changed in openstack-common:
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-common (stable/folsom)

Reviewed: https://review.openstack.org/12825
Committed: http://github.com/openstack/openstack-common/commit/9f88d8411200c8f716197da8b2ea19fe71ad702f
Submitter: Jenkins
Branch: stable/folsom

commit 9f88d8411200c8f716197da8b2ea19fe71ad702f
Author: Stuart McLaren <email address hidden>
Date: Mon Sep 10 09:46:06 2012 +0000

    Improve logging of process id

    Move process id to a fixed position in the logs, and to
    be present for all output (including eventlet and stack traces)
    as was the case previously.

    Fix for LP bug 1040772.

    Change-Id: I82639e730c2887630fbbee608a4d4da24862982d
    (cherry picked from commit ab6ceb0679c47149b34ce96215db16f406fdd160)

tags: added: in-stable-folsom
Mark McLoughlin (markmc)
Changed in nova:
status: New → Confirmed
importance: Undecided → Wishlist
Mark McLoughlin (markmc)
Changed in openstack-common:
milestone: none → 2012.2
status: Fix Committed → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in nova:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
tags: removed: in-stable-folsom
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
Revision history for this message
Erno Kuvaja (jokke) wrote :

Hi Stuart,

How we are doing with this?

Revision history for this message
Louis Taylor (kragniz) wrote :

This is also fixed in glance.

    2014-09-29 15:24:37.541 18367 DEBUG glance.common.client [46f34d46-3839-4155-9b0d-0a2b608968ca 531419b5526341dc91b81ce1cb3936aa 101d91817c364a5db16e9a8d759336c3 - - -] Constructed URL: http://0.0.0.0:9191/images/detail?sort_key=name&sort_dir=asc&limit=20 _construct_url /opt/stack/glance/glance/common/client.py:413
    2014-09-29 15:24:41.698 18367 DEBUG glance.registry.client.v1.client [46f34d46-3839-4155-9b0d-0a2b608968ca 531419b5526341dc91b81ce1cb3936aa 101d91817c364a5db16e9a8d759336c3 - - -] Registry request GET /images/detail HTTP 200 request id req-8f8736d5-48b7-4256-827e-55429e8819b2 do_request /opt/stack/glance/glance/registry/client/v1/client.py:122
    2014-09-29 15:24:41.700 18367 INFO glance.wsgi.server [46f34d46-3839-4155-9b0d-0a2b608968ca 531419b5526341dc91b81ce1cb3936aa 101d91817c364a5db16e9a8d759336c3 - - -] 10.0.0.22 - - [29/Sep/2014 15:24:41] "GET /v1/images/detail?sort_key=name&sort_dir=asc&limit=20 HTTP/1.1" 200 2287 6.814676

PID comes before the debug level now.

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: juno-rc1 → 2014.2
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.