Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Stackdriver Logging v2 API Samples

snippets.py is a simple command-line program to demonstrate writing to a log, listing its entries, and deleting it.

export.py demonstrates how to interact with sinks which are used to export logs to Google Cloud Storage, Cloud Pub/Sub, or BigQuery. The sample uses Google Cloud Storage, but can be easily adapted for other outputs.

Prerequisites

All samples require a Google Cloud Project.

To run export.py, you will also need a Google Cloud Storage Bucket.

gsutil mb gs://[YOUR_PROJECT_ID]

You must add Cloud Logging as an owner to the bucket. To do so, add cloud-logs@google.com as an owner to the bucket. See the exportings logs docs for complete details.

Running locally

Use the Cloud SDK to provide authentication:

gcloud beta auth application-default login

Run the samples:

python snippets.py -h
python export.py -h