Sha256: d2322c6c419e3b0dfe4ecf5d2c834403734e8bf28187cb16839d8332ecbd93f6

Contents?: true

Size: 997 Bytes

Versions: 20

Compression:

Stored size: 997 Bytes

Contents

# Enabling Logging

To enable logging for this library, set the logger for the underlying [Google
API
Client](https://github.com/google/google-api-ruby-client/blob/master/README.md#logging)
library. The logger that you set may be a Ruby stdlib
[`Logger`](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html) as
shown below, or a
[`Google::Cloud::Logging::Logger`](https://googleapis.github.io/google-cloud-ruby/docs/google-cloud-logging/latest/Google/Cloud/Logging/Logger)
that will write logs to [Stackdriver
Logging](https://cloud.google.com/logging/).

If you do not set the logger explicitly and your application is running in a
Rails environment, it will default to `Rails.logger`. Otherwise, if you do not
set the logger and you are not using Rails, logging is disabled by default.

Configuring a Ruby stdlib logger:

```ruby
require "logger"

my_logger = Logger.new $stderr
my_logger.level = Logger::WARN

# Set the Google API Client logger
Google::Apis.logger = my_logger
```

Version data entries

20 entries across 20 versions & 4 rubygems

Version Path
google-cloud-dns-0.30.1 LOGGING.md
google-cloud-storage-1.19.0 LOGGING.md
google-cloud-bigquery-1.12.0 LOGGING.md
google-cloud-bigquery-1.11.2 LOGGING.md
google-cloud-bigquery-1.11.1 LOGGING.md
google-cloud-storage-1.18.2 LOGGING.md
google-cloud-storage-1.18.1 LOGGING.md
google-cloud-storage-1.18.0 LOGGING.md
google-cloud-resource_manager-0.31.0 LOGGING.md
google-cloud-storage-1.17.0 LOGGING.md
google-cloud-storage-1.16.0 LOGGING.md
google-cloud-dns-0.30.0 LOGGING.md
google-cloud-bigquery-1.11.0 LOGGING.md
google-cloud-bigquery-1.10.0 LOGGING.md
google-cloud-bigquery-1.9.0 LOGGING.md
google-cloud-storage-1.15.0 LOGGING.md
google-cloud-storage-1.14.2 LOGGING.md
google-cloud-resource_manager-0.30.3 LOGGING.md
google-cloud-dns-0.29.4 LOGGING.md
google-cloud-bigquery-1.8.2 LOGGING.md