Skip to main content

Stackdriver Logging API client library

Project description

pypi versions compat_check_pypi compat_check_github

Stackdriver Logging API: Writes log entries and manages your Stackdriver Logging configuration.

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Stackdriver Logging API.
  4. Setup Authentication.


Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.

With virtualenv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

Supported Python Versions

Python >= 3.5

Deprecated Python Versions

Python == 2.7. Python 2.7 support will be removed on January 1, 2020.


pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-logging


pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\pip.exe install google-cloud-logging

Using the API

from import logging_v2

client = logging_v2.LoggingServiceV2Client()
entries = []
response = client.write_log_entries(entries)
from import logging
client = logging.Client()
logger = client.logger('log_name')
logger.log_text('A simple entry')  # API call

Example of fetching entries:

from import logging
client = logging.Client()
logger = client.logger('log_name')
for entry in logger.list_entries():

Next Steps

Project details

Download files

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

Files for google-cloud-logging, version 1.12.1
Filename, size & hash File type Python version Upload date
google_cloud_logging-1.12.1-py2.py3-none-any.whl (134.6 kB) View hashes Wheel py2.py3
google-cloud-logging-1.12.1.tar.gz (129.2 kB) View hashes 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