8000 Logging: cannot log on GCE · Issue #10 · googleapis/python-logging · GitHub
[go: up one dir, main page]

Skip to content
Logging: cannot log on GCE #10
Closed
@Lance0404

Description

@Lance0404

I have a web api deployed with docker image on GCP GCE. However failed to output any log to stackdriver logging under the tag which my VM stands for.

Most importantly, the same api deployed in my dev env (IDC) can sent log to GCP stackdriver logging successfully, which can be seen in stackdriver logging under the tag 'global'. Of course, with GOOGLE_APPLICATION_CREDENTIALS included.

Environment details

  1. Python 3.6.7
  2. ubuntu 18.04
  3. Cloud API access scopes: Allow full access to all Cloud APIs
  4. google related module
google-api-core==1.9.0
google-auth==1.6.3
google-cloud-core==0.29.1
google-cloud-logging==1.10.0
googleapis-common-protos==1.5.9
  1. the service account creating this VM has the role Logs Writer added.

Steps to reproduce

  1. deploy api with docker-compose within that GCE

Code example

  • this is how i prepare my cloud handler
client = google.cloud.logging.Client()
cloud_handler = CloudLoggingHandler(client, name='cloud')
logging.getLogger('cc').addHandler(cloud_handler)

Really appreciate any support. Let me know if further info are needed.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/python-logging API.priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0