Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/logging-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,22 @@ Export log entries using sinks
Sinks allow exporting entries which match a given filter to Cloud Storage
buckets, BigQuery datasets, or Cloud Pub/Sub topics.

Make sure that the storage bucket you want to export logs too has
`[email protected]` as the owner. See `Set permission for writing exported logs`_.

This comment was marked as spam.


Add `[email protected]` as the owner of `my-bucket-name`:

.. doctest::

>>> from gcloud import storage
>>> client = storage.Client()
>>> bucket = client.get_bucket('my-bucket-name')
>>> acl = bucket.acl
>>> acl.user('[email protected]').grant_owner()
>>> acl.save()

.. _Set permission for writing exported logs: https://cloud.google.com/logging/docs/export/configure_export#setting_product_name_short_permissions_for_writing_exported_logs

This comment was marked as spam.

Create a Cloud Storage sink:

.. doctest::
Expand Down