Module logger (3.7.0)

Define API Loggers.

Classes

Batch

Batch(logger, client, *, resource=None)

Context manager: collect entries to log via a single API call.

Helper returned by Logger.batch

Parameters
NameDescription
logger logging_v2.logger.Logger

the logger to which entries will be logged.

client logging_V2.client.Cilent

The client to use.

resource Optional[logging_v2.resource.Resource]

Monitored resource of the batch, defaults to None, which requires that every entry should have a resource specified. Since the methods used to write entries default the entry's resource to the global resource type, this parameter is only required if explicitly set to None. If no entries' resource are set to None, this parameter will be ignored on the server.

Logger

Logger(name, client, *, labels=None, resource=None)

Loggers represent named targets for log entries.

See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs