Open entropywtf opened 5 years ago
After looking closer and going through merged PRs I found out that reset method was exposed and it is actually a feature, BUT:
If you run into this error, you still have Rails.logger not set to Logstash. If Logstash logging is conditional in your application, you better put Rails.logger.reset under a condition likeif respond_to?(:reset)
or if ENV['LOGSTASH_ENABLED']
like I did in my project.
I'd suggest to put this advice into a README.
Thanks!
In case of multilogger, the instance does not respond to reset method.
logger.loggers.each { |_logger|
_logger.respond_to?(:reset)
}
This will work
Hi, Following the documentation, I put Rails.logger.reset into config/puma.rb
On server start though, I get an error:
undefined method
reset' for #fork' (NoMethodError ( 5: from /Users/marina/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in
block (2 levels) in spawn_workers' NoMethodErrorNoMethodError)`Thanks and sorry if I'm missing something obvious here. KR