GAPIC library for the Stackdriver Logging API

This is the API documentation for gapic-google-cloud-logging-v2.

gapic-google-cloud-logging-v2 uses google-gax (Google API extensions) to provide an easy-to-use client library for the Stackdriver Logging API (v2) defined in the googleapis git repository

APIs

google.cloud.gapic.logging.v2.config_service_v2_client Accesses the google.logging.v2 ConfigServiceV2 API.
google.cloud.gapic.logging.v2.enums Wrappers for protocol buffer enum types.
google.cloud.gapic.logging.v2.logging_service_v2_client Accesses the google.logging.v2 LoggingServiceV2 API.
google.cloud.gapic.logging.v2.metrics_service_v2_client Accesses the google.logging.v2 MetricsServiceV2 API.

Contents

Getting started

gapic-google-cloud-logging-v2 will allow you to connect to the Stackdriver Logging API and access all its methods. In order to achieve this, you need to set up authentication as well as install the library locally.

Installation

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.

Mac/Linux
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install gapic-google-cloud-logging-v2
Windows
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install gapic-google-cloud-logging-v2

Using the API

Authentication

To authenticate all your API calls, first install and setup the Google Cloud SDK. Once done, you can then run the following command in your terminal:

$ gcloud beta auth application-default login

or

$ gcloud auth login

Please see gcloud beta auth application-default login document for the difference between these commands.


At this point you are all set to continue.

Examples

To see example usage, please read through the API reference. The documentation for each API method includes simple examples.

Indices and tables