Logger
(
name
,
client
,
labels
=
None
)
Loggers represent named targets for log entries.
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs
Parameters
name
str
the name of the logger
client
Client
A client which holds credentials and project configuration for the logger (which requires a project).
labels
dict
(optional) mapping of default labels for entries written via this logger.
Properties
client
Clent bound to the logger.
full_name
Fully-qualified name used in logging APIs
path
URI path for use in logging APIs
project
Project bound to the logger.
Methods
batch
batch
(
client
=
None
)
Return a batch to use as a context manager.
client
Client
or NoneType
the client to use. If not passed, falls back to the client
stored on the current topic.
Batch
delete
delete
(
client
=
None
)
API call: delete all entries in a logger via a DELETE request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs/delete
client
Client
or NoneType
the client to use. If not passed, falls back to the client
stored on the current logger.
list_entries
list_entries
(
projects
=
None
,
filter_
=
None
,
order_by
=
None
,
page_size
=
None
,
page_token
=
None
)
Return a page of log entries.
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list
projects
list of strings
project IDs to include. If not passed, defaults to the project bound to the client.
filter_
order_by
str
One of :data: ASCENDING
or :data: DESCENDING
.
page_size
int
Optional. The maximum number of entries in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by the API.
page_token
str
Optional. If present, return the next batch of entries, using the value, which must correspond to the nextPageToken
value returned in the previous response. Deprecated: use the pages
property of the returned iterator instead of manually passing the token.
google.api_core.page_iterator.Iterator
log_empty
log_empty
(
client
=
None
,
**
kw
)
API call: log an empty message via a POST request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write
log_proto
log_proto
(
message
,
client
=
None
,
**
kw
)
API call: log a protobuf message via a POST request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list
log_struct
log_struct
(
info
,
client
=
None
,
**
kw
)
API call: log a structured message via a POST request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write
log_text
log_text
(
text
,
client
=
None
,
**
kw
)
API call: log a text message via a POST request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write