Sha256: 339e07c950b3e75a4a2f02cfecaa56dcdc74b3a7442e22e6fa7c5b38efd8ccc4

Contents?: true

Size: 982 Bytes

Versions: 156

Compression:

Stored size: 982 Bytes

Contents

# Enabling gRPC Logging

To enable logging for this library, set the logger for the underlying
[gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger
that you set may be a Ruby stdlib
[`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as
shown below, or a
[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
that will write logs to [Stackdriver
Logging](https://cloud.google.com/logging/). See
[grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
and the gRPC
[spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
for additional information.

Configuring a Ruby stdlib logger:

```ruby
require "logger"

module MyLogger
  LOGGER = Logger.new $stderr, level: Logger::WARN
  def logger
    LOGGER
  end
end

# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
module GRPC
  extend MyLogger
end
```

Version data entries

156 entries across 156 versions & 9 rubygems

Version Path
google-cloud-spanner-2.4.0 LOGGING.md
google-cloud-pubsub-2.3.2 LOGGING.md
google-cloud-spanner-2.3.0 LOGGING.md
google-cloud-bigtable-2.3.0 LOGGING.md
google-cloud-bigtable-2.2.1 LOGGING.md
google-cloud-pubsub-2.3.1 LOGGING.md
google-cloud-firestore-2.4.1 LOGGING.md
google-cloud-firestore-2.4.0 LOGGING.md
google-cloud-pubsub-2.3.0 LOGGING.md
google-cloud-pubsub-2.2.0 LOGGING.md
google-cloud-bigtable-2.2.0 LOGGING.md
google-cloud-pubsub-2.1.1 LOGGING.md
google-cloud-firestore-2.3.0 LOGGING.md
google-cloud-firestore-2.2.0 LOGGING.md
google-cloud-bigtable-2.1.0 LOGGING.md
google-cloud-datastore-2.1.0 LOGGING.md
google-cloud-pubsub-2.1.0 LOGGING.md
google-cloud-debugger-0.41.0 LOGGING.md
google-cloud-logging-2.1.0 LOGGING.md
google-cloud-error_reporting-0.41.0 LOGGING.md