lib/logstasher/railtie.rb in logstasher-1.3.0 vs lib/logstasher/railtie.rb in logstasher-1.4.0

- old
+ new

@@ -28,17 +28,22 @@ LogStasher.process_config(app.config.logstasher, LOGSTASHER) # process environment specific configs LogStasher.process_config(app.config.logstasher, LOGSTASHER[env].symbolize_keys) if LOGSTASHER.key? env end - app.config.action_dispatch.rack_cache[:verbose] = false if app.config.action_dispatch.rack_cache + app.config.action_dispatch.rack_cache[:verbose] = false if rack_cache_hashlike?(app) + LogStasher.setup_before(app.config.logstasher) if app.config.logstasher.enabled end initializer :logstasher do config.after_initialize do LogStasher.setup(config.logstasher) if config.logstasher.enabled end + end + + def rack_cache_hashlike?(app) + app.config.action_dispatch.rack_cache && app.config.action_dispatch.rack_cache.respond_to?(:[]=) end end def default_source case RUBY_PLATFORM