You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason there is not much sample code is that the idea is that you setup the fluentd logging agent (which is automatically setup on App Engine Flexible and for which we include instructions on GCE), and after that point you use standard Python logging. However you raise a valid point that the documentation is a little bit all over the place and a few more samples wouldn't hurt so I'll look into improving it.
I recently moved to the Flexible environment from App Engine Classic. Unfortunately, as a result, my logs are no longer nested within each request. The logs are all denormalized and it is difficult to track which error log goes to which request.
When I posted this on SO, I was told that in order to get nested logs back, I would need to write my own logger in python. So I started doing that, but quickly ran into a wall when I could not find any code on how to write a custom logger.
@speedplane while we do plan to eventually provide a logger that goes directly to cloud logging as mentioned in googleapis/google-cloud-python#1497, the bundling feature is to be determined.
App Engine Standard's serving path and sandbox restrictions allowed us to easily associate a request with associated logs. This is much more complicated in Flexible, so at the moment it's not currently possible to bundle logs to requests in the UI. Please keep in mind that Flexible is beta and will continue to evolve.
We'll leave this bug open to provide samples for the documentation page. @waprin do you mind taking that on? If not, feel free to assign to me.
@speedplane we have docs and samples on writing logs in Python. We also have a Python logging handler you might want to check out. Adding the trace id to nest the logs isn't done yet, not sure if the UI will support it yet either, we can re-open while I investigate that.
Activity
waprin commentedon Apr 29, 2016
The reason there is not much sample code is that the idea is that you setup the fluentd logging agent (which is automatically setup on App Engine Flexible and for which we include instructions on GCE), and after that point you use standard Python logging. However you raise a valid point that the documentation is a little bit all over the place and a few more samples wouldn't hurt so I'll look into improving it.
speedplane commentedon Apr 29, 2016
Thanks @waprin.
I recently moved to the Flexible environment from App Engine Classic. Unfortunately, as a result, my logs are no longer nested within each request. The logs are all denormalized and it is difficult to track which error log goes to which request.
When I posted this on SO, I was told that in order to get nested logs back, I would need to write my own logger in python. So I started doing that, but quickly ran into a wall when I could not find any code on how to write a custom logger.
theacodes commentedon Apr 29, 2016
See also: googleapis/google-cloud-python#1497
theacodes commentedon May 6, 2016
@speedplane while we do plan to eventually provide a logger that goes directly to cloud logging as mentioned in googleapis/google-cloud-python#1497, the bundling feature is to be determined.
App Engine Standard's serving path and sandbox restrictions allowed us to easily associate a request with associated logs. This is much more complicated in Flexible, so at the moment it's not currently possible to bundle logs to requests in the UI. Please keep in mind that Flexible is beta and will continue to evolve.
We'll leave this bug open to provide samples for the documentation page. @waprin do you mind taking that on? If not, feel free to assign to me.
speedplane commentedon Sep 20, 2016
@jonparrott Just curious, why was this closed?
waprin commentedon Sep 20, 2016
@speedplane we have docs and samples on writing logs in Python. We also have a Python logging handler you might want to check out. Adding the trace id to nest the logs isn't done yet, not sure if the UI will support it yet either, we can re-open while I investigate that.
theacodes commentedon Feb 28, 2017
(Closing due to inactivity, feel free to comment and we'll re-open)
13 remaining items
chore(samples): add and fix comments (#312)
chore(python): add nox session to sort python imports (#312)
chore(python): add nox session to sort python imports (#312)
chore(python): add nox session to sort python imports (#312)
chore(deps): update all dependencies (#312)
chore(deps): update dependency google-cloud-bigquery-reservation to v…
chore(deps): update dependency google-cloud-bigquery-reservation to v…
chore(deps): update dependency google-cloud-bigquery-reservation to v…
chore(deps): update dependency google-cloud-bigquery-reservation to v…
chore(python): add nox session to sort python imports (#312)
chore(python): add nox session to sort python imports (#312)
docs(samples): add samples for IN, NOT_IN, and != operators. (#312)
chore(deps): update dependency google-cloud-bigquery to v2.18.0 (#312)
migrate code from googleapis/python-logging (#13844)
chore: migrate code from googleapis/python-datastore (#13837)