Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Stackdriver Logging API client library

Project description

Python idiomatic client for Stackdriver Logging

pypi versions

Quick Start

$ 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.

Authentication

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

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 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
google_cloud_logging-1.6.0-py2.py3-none-any.whl (101.9 kB) Copy SHA256 hash SHA256 Wheel py2.py3
google-cloud-logging-1.6.0.tar.gz (105.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page