ContainerEngineHandler(name=None, stream=None)
Handler to format log messages the format expected by GKE fluent.
This handler is written to format messages for the Google Container Engine (GKE) fluentd plugin, so that metadata such as log level are properly set.
Parameters |
|
---|---|
Name | Description |
name |
str
(optional) the name of the custom log in Stackdriver Logging. |
stream |
file-like object
(optional) stream to be used by the handler. |
Methods
ContainerEngineHandler
ContainerEngineHandler(name=None, stream=None)
Initialize the handler.
If stream is not specified, sys.stderr is used.
format
format(record)
Format the message into JSON expected by fluentd.
Parameter | |
---|---|
Name | Description |
record |
the log record |
Returns | |
---|---|
Type | Description |
str |
A JSON string formatted for GKE fluentd. |