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:
require"logger"my_logger=Logger.new$stderrmy_logger.level=Logger::WARN# Set the Google API Client loggerGoogle::Apis.logger=my_logger
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-dns/latest/LOGGING)\n- [1.0.0](/ruby/docs/reference/google-cloud-dns/1.0.0/LOGGING)\n- [0.37.0](/ruby/docs/reference/google-cloud-dns/0.37.0/LOGGING)\n- [0.36.1](/ruby/docs/reference/google-cloud-dns/0.36.1/LOGGING)\n- [0.35.1](/ruby/docs/reference/google-cloud-dns/0.35.1/LOGGING) \n\nEnabling Logging\n================\n\nTo enable logging for this library, set the logger for the underlying [Google\nAPI\nClient](https://github.com/google/google-api-ruby-client/blob/master/README.md#logging)\nlibrary. The logger that you set may be a Ruby stdlib\n[`Logger`](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html) as\nshown below, or a\n[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)\nthat will write logs to [Stackdriver\nLogging](https://cloud.google.com/logging/).\n\nIf you do not set the logger explicitly and your application is running in a\nRails environment, it will default to `Rails.logger`. Otherwise, if you do not\nset the logger and you are not using Rails, logging is disabled by default.\n\nConfiguring a Ruby stdlib logger: \n\n```ruby\nrequire \"logger\"\n\nmy_logger = Logger.new $stderr\nmy_logger.level = Logger::WARN\n\n# Set the Google API Client logger\nGoogle::Apis.logger = my_logger\n```"]]