AppEngineHandler(client, *, name='app', transport=<class 'google.cloud.logging_v2.handlers.transports.background_thread.BackgroundThreadTransport'>, stream=None)
A logging handler that sends App Engine-formatted logs to Stackdriver.
DEPRECATED: use CloudLoggingHandler instead.
Inheritance
builtins.object > logging.Filterer > logging.Handler > logging.StreamHandler > AppEngineHandlerMethods
AppEngineHandler
AppEngineHandler(client, *, name='app', transport=<class 'google.cloud.logging_v2.handlers.transports.background_thread.BackgroundThreadTransport'>, stream=None)
Name | Description |
client |
`logging_v2.client.Client`
The authenticated Google Cloud Logging client for this handler to use. |
name |
Optional[str]
Name for the logger. |
transport |
Optional[`logging_v2.transports.Transport`]
The transport class. It should be a subclass of |
stream |
Optional[IO]
Stream to be used by the handler. |
emit
emit(record)
Actually log the specified logging record.
Overrides the default emit behavior of StreamHandler
.
See https://docs.python.org/2/library/logging.html#handler-objects
Name | Description |
record |
logging.LogRecord
The record to be logged. |
get_gae_labels
get_gae_labels()
Return the labels for GAE app.
If the trace ID can be detected, it will be included as a label. Currently, no other labels are included.
Type | Description |
dict | Labels for GAE app. |
get_gae_resource
get_gae_resource()
Return the GAE resource using the environment variables.
Type | Description |
google.cloud.logging_v2.resource.Resource | Monitored resource for GAE. |