Support log name in StructuredLoggingHandler #842
Labels
api: logging
Issues related to the googleapis/python-logging API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
When configuring locally, i can set the logName by using
client.setup_logging(name='my-api')
and it works correctly. My logs show up as 'my-api' in the "select log name" dropdown in the log explorer. However, the moment I deploy it to GKE, it crashes stating thename
argument is unexpected. Digging through the code, I noticed it is because, when deployed locally, it selects CloudLoggingHandler which accepts thename
argument, but when it's deployed to GKE, it selects StructuredLoggingHandler which does not. This is frustrating for a couple reasons:logging.getLogger('my-api')
but then that forces me to add extras to every log statement if I want to add labels to help further scope my logs.Describe the solution you'd like
Support the log name in StructuredLoggingHandler. For comparison, our .NET solutions don't have this problem. It behaves the same way regardless of where it's deployed.
Describe alternatives you've considered
Point 3 of the problem statement. This is additionally problematic in a large enterprise where we're trying to build tools around log routing due to the inconsistency of how logs are partitioned. It's an inconsistent experience if nothing else.
Additional context
The text was updated successfully, but these errors were encountered: