Python idiomatic client for Stackdriver Logging
$ pip install --upgrade google-cloud-loggingWith google-cloud-python we try to make authentication as painless as
possible. Check out the Authentication section in our documentation to
learn more. You may also find the authentication document shared by all
the google-cloud-* libraries to be helpful.
Stackdriver Logging API (Logging API docs) allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform.
from google.cloud import logging
client = logging.Client()
logger = client.logger('log_name')
logger.log_text('A simple entry') # API callExample of fetching entries:
for entry in logger.list_entries():
print(entry.payload)See the google-cloud-python API logging documentation to learn how to
connect to Stackdriver Logging using this Client Library.