Google-cloud-ruby: undefined method `silence_logger' for #<Google::Cloud::Logging::Logger:0x00000007d4c090> Did you mean? silencer

Created on 14 Mar 2018  路  2Comments  路  Source: googleapis/google-cloud-ruby

I've tried to use it on one of my projects but the following error appears:

undefined method `silence_logger' for #<Google::Cloud::Logging::Logger:0x00000007d4c090> Did you mean? silencer

Backtrace looks like this:


[GEM_ROOT]/bundler/gems/activerecord-session_store-b5e7da210c93/lib/action_dispatch/session/active_record_store.rb:69聽鈫捖爂et_session
--
[GEM_ROOT]/bundler/gems/activerecord-session_store-b5e7da210c93/lib/action_dispatch/session/legacy_support.rb:21聽鈫捖爂et_session
rack-1.6.9/lib/rack/session/abstract/id.rb:266聽鈫捖爈oad_session
actionpack-4.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:43聽鈫捖燽lock in load_session
actionpack-4.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:51聽鈫捖爏tale_session_check!
actionpack-4.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:43聽鈫捖爈oad_session
actionpack-4.2.8/lib/action_dispatch/request/session.rb:180聽鈫捖爈oad!
actionpack-4.2.8/lib/action_dispatch/request/session.rb:176聽鈫捖爈oad_for_write!
actionpack-4.2.8/lib/action_dispatch/request/session.rb:109聽鈫捖燵]=
devise-4.4.0/lib/devise/controllers/store_location.rb:40聽鈫捖爏tore_location_for
devise-4.4.0/lib/devise/failure_app.rb:235聽鈫捖爏tore_location!
devise-4.4.0/lib/devise/failure_app.rb:79聽鈫捖爎edirect
devise-4.4.0/lib/devise/failure_app.rb:43聽鈫捖爎espond
actionpack-4.2.8/lib/abstract_controller/base.rb:198聽鈫捖爌rocess_action
actionpack-4.2.8/lib/abstract_controller/base.rb:137聽鈫捖爌rocess
actionpack-4.2.8/lib/action_controller/metal.rb:196聽鈫捖燿ispatch
actionpack-4.2.8/lib/action_controller/metal/rack_delegation.rb:13聽鈫捖燿ispatch
actionpack-4.2.8/lib/action_controller/metal.rb:237聽鈫捖燽lock in action
devise-4.4.0/lib/devise/failure_app.rb:23聽鈫捖燾all
devise-4.4.0/lib/devise/delegator.rb:7聽鈫捖燾all
warden-1.2.7/lib/warden/manager.rb:143聽鈫捖燾all_failure_app
warden-1.2.7/lib/warden/manager.rb:129聽鈫捖爌rocess_unauthenticated
warden-1.2.7/lib/warden/manager.rb:44聽鈫捖燾all
google-cloud-debugger-0.31.0/lib/google/cloud/debugger/middleware.rb:84聽鈫捖燾all
rack-1.6.9/lib/rack/etag.rb:24聽鈫捖燾all

rack-1.6.9/lib/rack/conditionalget.rb:25聽鈫捖燾all
rack-1.6.9/lib/rack/head.rb:13聽鈫捖燾all
remotipart-1.3.1/lib/remotipart/middleware.rb:32聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/params_parser.rb:27聽鈫捖燾all
app/middleware/catch_json_parse_errors.rb:8聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/flash.rb:260聽鈫捖燾all
rack-1.6.9/lib/rack/session/abstract/id.rb:225聽鈫捖燾ontext
rack-1.6.9/lib/rack/session/abstract/id.rb:220聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/cookies.rb:560聽鈫捖燾all
activerecord-4.2.8/lib/active_record/query_cache.rb:36聽鈫捖燾all
airbrake-6.1.2/lib/airbrake/rack/middleware.rb:52聽鈫捖燾all
activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:653聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:29聽鈫捖燽lock in call
activesupport-4.2.8/lib/active_support/callbacks.rb:88聽鈫捖燺_run_callbacks__
activesupport-4.2.8/lib/active_support/callbacks.rb:778聽鈫捖燺run_call_callbacks
activesupport-4.2.8/lib/active_support/callbacks.rb:81聽鈫捖爎un_callbacks
actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:27聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/remote_ip.rb:78聽鈫捖燾all
google-cloud-error_reporting-0.30.0/lib/google/cloud/error_reporting/middleware.rb:75聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:17聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb:30聽鈫捖燾all
railties-4.2.8/lib/rails/rack/logger.rb:38聽鈫捖燾all_app
railties-4.2.8/lib/rails/rack/logger.rb:22聽鈫捖燾all
google-cloud-logging-1.5.0/lib/google/cloud/logging/middleware.rb:91聽鈫捖燾all
request_store-1.4.0/lib/request_store/middleware.rb:19聽鈫捖燾all
actionpack-4.2.8/lib/action_dispatch/middleware/request_id.rb:21聽鈫捖燾all
rack-1.6.9/lib/rack/methodoverride.rb:22聽鈫捖燾all
rack-1.6.9/lib/rack/runtime.rb:18聽鈫捖燾all
google-cloud-trace-0.31.0/lib/google/cloud/trace/middleware.rb:156聽鈫捖燽lock in call
google-cloud-trace-0.31.0/lib/google/cloud/trace.rb:408聽鈫捖燽lock in in_span
google-cloud-trace-0.31.0/lib/google/cloud/trace/trace_record.rb:232聽鈫捖爄n_span
google-cloud-trace-0.31.0/lib/google/cloud/trace.rb:405聽鈫捖爄n_span
google-cloud-trace-0.31.0/lib/google/cloud/trace/middleware.rb:154聽鈫捖燾all
rack-1.6.9/lib/rack/sendfile.rb:113聽鈫捖燾all
rack-cors-0.4.1/lib/rack/cors.rb:81聽鈫捖燾all
railties-4.2.8/lib/rails/engine.rb:518聽鈫捖燾all
railties-4.2.8/lib/rails/application.rb:165聽鈫捖燾all
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97聽鈫捖爌rocess_request

/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152聽鈫捖燼ccept_and_process_next_request
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113聽鈫捖爉ain_loop
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416聽鈫捖燽lock (3 levels) in start_threads
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113聽鈫捖燽lock in create_thread_and_abort_on_exception


App is using ruby 2.4.1 and Rails 4.2.8

Any ideas?

logging question

Most helpful comment

Hi @MatUrbanski, thanks for the question. If you look at the activerecord-session_store README it states:

Please note that you will need to manually include the silencer module to your custom logger if you are using a logger other than Logger and Syslog::Logger and their subclasses:

MyLogger.send :include, ActiveRecord::SessionStore::Extension::LoggerSilencer

This silencer is being used to silence the logger and not leaking private information into the log, and it is required for security reason.

All 2 comments

Hi @MatUrbanski, thanks for the question. If you look at the activerecord-session_store README it states:

Please note that you will need to manually include the silencer module to your custom logger if you are using a logger other than Logger and Syslog::Logger and their subclasses:

MyLogger.send :include, ActiveRecord::SessionStore::Extension::LoggerSilencer

This silencer is being used to silence the logger and not leaking private information into the log, and it is required for security reason.

Closing as this questions appears to be answered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ricowere picture Ricowere  路  4Comments

jeremywadsack picture jeremywadsack  路  3Comments

premist picture premist  路  3Comments

ight-reco picture ight-reco  路  4Comments

NirKamara picture NirKamara  路  4Comments