Package Methods (3.11.0)

Summary of entries of Methods for logging.

google.cloud.logging_v2.entries.logger_name_from_path

logger_name_from_path(path, project=None)

Validate a logger URI path and get the logger name.

See more: google.cloud.logging_v2.entries.logger_name_from_path

google.cloud.logging_v2.handlers.handlers.setup_logging

setup_logging(
    handler, *, excluded_loggers=("google.api_core.bidi", "werkzeug"), log_level=20
)

Attach a logging handler to the Python root logger.

See more: google.cloud.logging_v2.handlers.handlers.setup_logging

google.cloud.logging_v2.client.Client

Client(
    *,
    project=None,
    credentials=None,
    _http=None,
    _use_grpc=None,
    client_info=None,
    client_options=None
)

google.cloud.logging_v2.client.Client.get_default_handler

get_default_handler(**kw)

Return the default logging handler based on the local environment.

See more: google.cloud.logging_v2.client.Client.get_default_handler

google.cloud.logging_v2.client.Client.list_entries

list_entries(
    *,
    resource_names=None,
    filter_=None,
    order_by=None,
    max_results=None,
    page_size=None,
    page_token=None
)

Return a generator of log entry resources.

See more: google.cloud.logging_v2.client.Client.list_entries

google.cloud.logging_v2.client.Client.list_metrics

list_metrics(*, max_results=None, page_size=None, page_token=None)

List metrics for the project associated with this client.

See more: google.cloud.logging_v2.client.Client.list_metrics

google.cloud.logging_v2.client.Client.list_sinks

list_sinks(*, parent=None, max_results=None, page_size=None, page_token=None)

List sinks for the a parent resource.

See more: google.cloud.logging_v2.client.Client.list_sinks

google.cloud.logging_v2.client.Client.logger

logger(name, *, labels=None, resource=None)

Creates a logger bound to the current client.

See more: google.cloud.logging_v2.client.Client.logger

google.cloud.logging_v2.client.Client.metric

metric(name, *, filter_=None, description="")

Creates a metric bound to the current client.

See more: google.cloud.logging_v2.client.Client.metric

google.cloud.logging_v2.client.Client.setup_logging

setup_logging(
    *, log_level=20, excluded_loggers=("google.api_core.bidi", "werkzeug"), **kw
)

Attach default Cloud Logging handler to the root logger.

See more: google.cloud.logging_v2.client.Client.setup_logging

google.cloud.logging_v2.client.Client.sink

sink(name, *, filter_=None, destination=None)

Creates a sink bound to the current client.

See more: google.cloud.logging_v2.client.Client.sink

google.cloud.logging_v2.entries.LogEntry

LogEntry(
    log_name=None,
    labels=None,
    insert_id=None,
    severity=None,
    http_request=None,
    timestamp=None,
    resource=Resource(type="global", labels={}),
    trace=None,
    span_id=None,
    trace_sampled=None,
    source_location=None,
    operation=None,
    logger=None,
    payload=None,
)

Create new instance of LogEntry(log_name, labels, insert_id, severity, http_request, timestamp, resource, trace, span_id, trace_sampled, source_location, operation, logger, payload).

See more: google.cloud.logging_v2.entries.LogEntry

google.cloud.logging_v2.entries.LogEntry.from_api_repr

from_api_repr(resource, client, *, loggers=None)

Construct an entry given its API representation .

See more: google.cloud.logging_v2.entries.LogEntry.from_api_repr

google.cloud.logging_v2.entries.LogEntry.to_api_repr

to_api_repr()

API repr (JSON format) for entry.

See more: google.cloud.logging_v2.entries.LogEntry.to_api_repr

google.cloud.logging_v2.entries.ProtobufEntry

ProtobufEntry(
    log_name=None,
    labels=None,
    insert_id=None,
    severity=None,
    http_request=None,
    timestamp=None,
    resource=Resource(type="global", labels={}),
    trace=None,
    span_id=None,
    trace_sampled=None,
    source_location=None,
    operation=None,
    logger=None,
    payload=None,
)

Create new instance of LogEntry(log_name, labels, insert_id, severity, http_request, timestamp, resource, trace, span_id, trace_sampled, source_location, operation, logger, payload).

See more: google.cloud.logging_v2.entries.ProtobufEntry

google.cloud.logging_v2.entries.ProtobufEntry.parse_message

parse_message(message)

Parse payload into a protobuf message.

See more: google.cloud.logging_v2.entries.ProtobufEntry.parse_message

google.cloud.logging_v2.entries.ProtobufEntry.to_api_repr

to_api_repr()

API repr (JSON format) for entry.

See more: google.cloud.logging_v2.entries.ProtobufEntry.to_api_repr

google.cloud.logging_v2.entries.StructEntry

StructEntry(
    log_name=None,
    labels=None,
    insert_id=None,
    severity=None,
    http_request=None,
    timestamp=None,
    resource=Resource(type="global", labels={}),
    trace=None,
    span_id=None,
    trace_sampled=None,
    source_location=None,
    operation=None,
    logger=None,
    payload=None,
)

Create new instance of LogEntry(log_name, labels, insert_id, severity, http_request, timestamp, resource, trace, span_id, trace_sampled, source_location, operation, logger, payload).

See more: google.cloud.logging_v2.entries.StructEntry

google.cloud.logging_v2.entries.StructEntry.to_api_repr

to_api_repr()

API repr (JSON format) for entry.

See more: google.cloud.logging_v2.entries.StructEntry.to_api_repr

google.cloud.logging_v2.entries.TextEntry

TextEntry(
    log_name=None,
    labels=None,
    insert_id=None,
    severity=None,
    http_request=None,
    timestamp=None,
    resource=Resource(type="global", labels={}),
    trace=None,
    span_id=None,
    trace_sampled=None,
    source_location=None,
    operation=None,
    logger=None,
    payload=None,
)

Create new instance of LogEntry(log_name, labels, insert_id, severity, http_request, timestamp, resource, trace, span_id, trace_sampled, source_location, operation, logger, payload).

See more: google.cloud.logging_v2.entries.TextEntry

google.cloud.logging_v2.entries.TextEntry.to_api_repr

to_api_repr()

API repr (JSON format) for entry.

See more: google.cloud.logging_v2.entries.TextEntry.to_api_repr

google.cloud.logging_v2.handlers.app_engine.AppEngineHandler

AppEngineHandler(client, *, name='app', transport=

google.cloud.logging_v2.handlers.app_engine.AppEngineHandler.emit

emit(record)

Actually log the specified logging record.

See more: google.cloud.logging_v2.handlers.app_engine.AppEngineHandler.emit

google.cloud.logging_v2.handlers.app_engine.AppEngineHandler.get_gae_labels

get_gae_labels()

google.cloud.logging_v2.handlers.app_engine.AppEngineHandler.get_gae_resource

get_gae_resource()

Return the GAE resource using the environment variables.

See more: google.cloud.logging_v2.handlers.app_engine.AppEngineHandler.get_gae_resource

google.cloud.logging_v2.handlers.container_engine.ContainerEngineHandler

ContainerEngineHandler(*, name=None, stream=None)

google.cloud.logging_v2.handlers.container_engine.ContainerEngineHandler.format

format(record)

Format the message into JSON expected by fluentd.

See more: google.cloud.logging_v2.handlers.container_engine.ContainerEngineHandler.format

google.cloud.logging_v2.handlers.handlers.CloudLoggingFilter

CloudLoggingFilter(project=None, default_labels=None)

google.cloud.logging_v2.handlers.handlers.CloudLoggingFilter.filter

filter(record)

Add new Cloud Logging data to each LogRecord as it comes in.

See more: google.cloud.logging_v2.handlers.handlers.CloudLoggingFilter.filter

google.cloud.logging_v2.handlers.handlers.CloudLoggingHandler

CloudLoggingHandler(client, *, name: str = 'python', transport: google.cloud.logging_v2.handlers.transports.base.Transport = 

google.cloud.logging_v2.handlers.handlers.CloudLoggingHandler.emit

emit(record)

Actually log the specified logging record.

See more: google.cloud.logging_v2.handlers.handlers.CloudLoggingHandler.emit

google.cloud.logging_v2.handlers.structured_log.StructuredLogHandler

StructuredLogHandler(
    *, labels=None, stream=None, project_id=None, json_encoder_cls=None, **kwargs
)

google.cloud.logging_v2.handlers.structured_log.StructuredLogHandler.emit

emit(record)

google.cloud.logging_v2.handlers.structured_log.StructuredLogHandler.format

format(record)

Format the message into structured log JSON.

See more: google.cloud.logging_v2.handlers.structured_log.StructuredLogHandler.format

google.cloud.logging_v2.handlers.transports.background_thread.BackgroundThreadTransport

BackgroundThreadTransport(
    client,
    name,
    *,
    grace_period=5.0,
    batch_size=10,
    max_latency=0,
    resource=Resource(type="global", labels={}),
    **kwargs
)

google.cloud.logging_v2.handlers.transports.background_thread.BackgroundThreadTransport.flush

flush()

google.cloud.logging_v2.handlers.transports.background_thread.BackgroundThreadTransport.send

send(record, message, **kwargs)

google.cloud.logging_v2.handlers.transports.base.Transport

Transport(client, name, resource=Resource(type="global", labels={}), **kwargs)

google.cloud.logging_v2.handlers.transports.base.Transport.flush

flush()

Submit any pending log records.

See more: google.cloud.logging_v2.handlers.transports.base.Transport.flush

google.cloud.logging_v2.handlers.transports.base.Transport.send

send(record, message, **kwargs)

Transport send to be implemented by subclasses.

See more: google.cloud.logging_v2.handlers.transports.base.Transport.send

google.cloud.logging_v2.handlers.transports.sync.SyncTransport

SyncTransport(client, name, resource=Resource(type="global", labels={}), **kwargs)

google.cloud.logging_v2.handlers.transports.sync.SyncTransport.send

send(record, message, **kwargs)

google.cloud.logging_v2.logger.Batch.commit

commit(*, client=None, partial_success=True)

Send saved log entries as a single API call.

See more: google.cloud.logging_v2.logger.Batch.commit

google.cloud.logging_v2.logger.Batch.log

log(message=None, **kw)

Add an arbitrary message to be logged during commit.

See more: google.cloud.logging_v2.logger.Batch.log

google.cloud.logging_v2.logger.Batch.log_empty

log_empty(**kw)

Add a entry without payload to be logged during commit.

See more: google.cloud.logging_v2.logger.Batch.log_empty

google.cloud.logging_v2.logger.Batch.log_proto

log_proto(message, **kw)

Add a protobuf entry to be logged during commit.

See more: google.cloud.logging_v2.logger.Batch.log_proto

google.cloud.logging_v2.logger.Batch.log_struct

log_struct(info, **kw)

Add a struct entry to be logged during commit.

See more: google.cloud.logging_v2.logger.Batch.log_struct

google.cloud.logging_v2.logger.Batch.log_text

log_text(text, **kw)

Add a text entry to be logged during commit.

See more: google.cloud.logging_v2.logger.Batch.log_text

google.cloud.logging_v2.logger.Logger

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

google.cloud.logging_v2.logger.Logger.batch

batch(*, client=None)

Return a batch to use as a context manager.

See more: google.cloud.logging_v2.logger.Logger.batch

google.cloud.logging_v2.logger.Logger.delete

delete(logger_name=None, *, client=None)

Delete all entries in a logger via a DELETE request.

See more: google.cloud.logging_v2.logger.Logger.delete

google.cloud.logging_v2.logger.Logger.list_entries

list_entries(
    *,
    resource_names=None,
    filter_=None,
    order_by=None,
    max_results=None,
    page_size=None,
    page_token=None
)

Return a generator of log entry resources.

See more: google.cloud.logging_v2.logger.Logger.list_entries

google.cloud.logging_v2.logger.Logger.log

log(message=None, *, client=None, **kw)

Log an arbitrary message.

See more: google.cloud.logging_v2.logger.Logger.log

google.cloud.logging_v2.logger.Logger.log_empty

log_empty(*, client=None, **kw)

Log an empty message.

See more: google.cloud.logging_v2.logger.Logger.log_empty

google.cloud.logging_v2.logger.Logger.log_proto

log_proto(message, *, client=None, **kw)

Log a protobuf message.

See more: google.cloud.logging_v2.logger.Logger.log_proto

google.cloud.logging_v2.logger.Logger.log_struct

log_struct(info, *, client=None, **kw)

Log a dictionary message.

See more: google.cloud.logging_v2.logger.Logger.log_struct

google.cloud.logging_v2.logger.Logger.log_text

log_text(text, *, client=None, **kw)

Log a text message.

See more: google.cloud.logging_v2.logger.Logger.log_text

google.cloud.logging_v2.metric.Metric

Metric(name, *, filter_=None, client=None, description="")

google.cloud.logging_v2.metric.Metric.create

create(*, client=None)

Create the metric via a PUT request.

See more: google.cloud.logging_v2.metric.Metric.create

google.cloud.logging_v2.metric.Metric.delete

delete(*, client=None)

API call: delete a metric via a DELETE request.

See more: google.cloud.logging_v2.metric.Metric.delete

google.cloud.logging_v2.metric.Metric.exists

exists(*, client=None)

Test for the existence of the metric via a GET request.

See more: google.cloud.logging_v2.metric.Metric.exists

google.cloud.logging_v2.metric.Metric.from_api_repr

from_api_repr(resource, client)

Construct a metric given its API representation .

See more: google.cloud.logging_v2.metric.Metric.from_api_repr

google.cloud.logging_v2.metric.Metric.reload

reload(*, client=None)

API call: sync local metric configuration via a GET request.

See more: google.cloud.logging_v2.metric.Metric.reload

google.cloud.logging_v2.metric.Metric.update

update(*, client=None)

API call: update metric configuration via a PUT request.

See more: google.cloud.logging_v2.metric.Metric.update

google.cloud.logging_v2.resource.Resource

Resource(type, labels)

Create new instance of Resource(type, labels).

See more: google.cloud.logging_v2.resource.Resource

google.cloud.logging_v2.sink.Sink

Sink(name, *, filter_=None, parent=None, destination=None, client=None)

google.cloud.logging_v2.sink.Sink.create

create(*, client=None, unique_writer_identity=False)

Create the sink via a PUT request.

See more: google.cloud.logging_v2.sink.Sink.create

google.cloud.logging_v2.sink.Sink.delete

delete(*, client=None)

Delete a sink via a DELETE request.

See more: google.cloud.logging_v2.sink.Sink.delete

google.cloud.logging_v2.sink.Sink.exists

exists(*, client=None)

Test for the existence of the sink via a GET request.

See more: google.cloud.logging_v2.sink.Sink.exists

google.cloud.logging_v2.sink.Sink.from_api_repr

from_api_repr(resource, client, *, parent=None)

Construct a sink given its API representation .

See more: google.cloud.logging_v2.sink.Sink.from_api_repr

google.cloud.logging_v2.sink.Sink.reload

reload(*, client=None)

Sync local sink configuration via a GET request.

See more: google.cloud.logging_v2.sink.Sink.reload

google.cloud.logging_v2.sink.Sink.update

update(*, client=None, unique_writer_identity=False)

Update sink configuration via a PUT request.

See more: google.cloud.logging_v2.sink.Sink.update