Sha256: 64d3e1679f106302dfc035914b9a70173a65d3e7237b3b4d5a5931b44e94954d

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

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://googlecloudplatform.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/). 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

10 entries across 10 versions & 10 rubygems

Version Path
google-cloud-vision-0.30.3 LOGGING.md
google-cloud-trace-0.33.4 LOGGING.md
google-cloud-spanner-1.6.3 LOGGING.md
google-cloud-pubsub-0.32.2 LOGGING.md
google-cloud-logging-1.5.4 LOGGING.md
google-cloud-firestore-0.24.1 LOGGING.md
google-cloud-error_reporting-0.30.4 LOGGING.md
google-cloud-debugger-0.32.4 LOGGING.md
google-cloud-datastore-1.4.3 LOGGING.md
google-cloud-bigtable-0.1.2 LOGGING.md