Sha256: 83a0b6435da5651bdcd228d742affd252393649dacd930d301d2ae06f89e5d7f

Contents?: true

Size: 1.01 KB

Versions: 75

Compression:

Stored size: 1.01 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://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/). 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

75 entries across 75 versions & 10 rubygems

Version Path
google-cloud-pubsub-0.33.2 LOGGING.md
google-cloud-spanner-1.7.1 LOGGING.md
google-cloud-pubsub-0.33.1 LOGGING.md
google-cloud-logging-1.5.6 LOGGING.md
google-cloud-vision-0.31.0 LOGGING.md
google-cloud-vision-0.30.4 LOGGING.md
google-cloud-trace-0.33.5 LOGGING.md
google-cloud-spanner-1.6.4 LOGGING.md
google-cloud-pubsub-0.33.0 LOGGING.md
google-cloud-logging-1.5.5 LOGGING.md
google-cloud-firestore-0.24.2 LOGGING.md
google-cloud-error_reporting-0.30.5 LOGGING.md
google-cloud-debugger-0.32.5 LOGGING.md
google-cloud-datastore-1.4.4 LOGGING.md
google-cloud-bigtable-0.1.3 LOGGING.md