Python Client for Stackdriver Logging
Python idiomatic client for Stackdriver Logging
$ pip install --upgrade google-cloud-logging
For more information on setting up your Python development environment, such as installing pip and virtualenv on your system, please refer to Python Development Environment Setup Guide for Google Cloud Platform.
Note: The creation of cross project sinks (log exports) is not currenlty supported. You may only create sinks within the same project set for the client. In other words, the parameter uniqueWriterIdentity is not yet available.
With 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.
Using the API
from google.cloud import logging client = logging.Client() logger = client.logger('log_name') logger.log_text('A simple entry') # API call
Example 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.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for google-cloud-logging-1.5.0.tar.gz
Hashes for google_cloud_logging-1.5.0-py2.py3-none-any.whl