Trying to get appengine logging working under Pyramid. 

Log entries are appearing, but they aren't grouped in the same request. Not 
only are they not grouped in the same request, but I'm getting a duplicate 
as well.

[image: chrome_hZKb2p0Zdr.png]

For those that aren't familiar with googles Logging system, the top line 
should have the blue icon indicating the request contains an INFO log, and 
clicking on it should expand to show all of the logging calls that were 
made during that request. For example:

[image: chrome_LiowoZYVa5.png]

As you can see there, that particular request contains 2 logging entries, 
so we see them there when that line is expanded.

In order for log entries to be grouped together, the api needs to know what 
request its a part of. Both django and flask appear to have methods 
available to determine what the current request is, and look for a 
particular header within that request. 

Here is the place where I think needs an addition for Pyramid to be 
supported here.   

https://github.com/googleapis/python-logging/blob/master/google/cloud/logging/handlers/_helpers.py#L49-L65

I see that pyramid has "pyramid.threadlocal.get_current_request()" but the 
documentation seems to indicate that that maybe shouldn't be used.

Can anyone point me in the right direction?

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/de2b00ee-536a-468f-bb13-dcccd6cdf46dn%40googlegroups.com.

Reply via email to