How can I disable logging for caching in "rails 4.1"? Specifically I'm trying to get rid of fragment caching log entries like these:
Write fragment views/... (0.3ms)
Read fragment views/... (0.3ms)
How about this?
# config/initializers/log_subscriber.rb
module ActionController
class LogSubscriber < ActiveSupport::LogSubscriber
%w(write_fragment read_fragment exist_fragment?
expire_fragment expire_page write_page).each do |method|
class_eval <<-METHOD, __FILE__, __LINE__ + 1
def #{method}(event)
return
end
METHOD
end
end
end
Test locally with:
# config/environments/development.rb
config.action_controller.perform_caching = true
(With the usual caveat to test carefully in your own app. This "works," but is the hammer method, and can trap you or other, unwary programmers later.)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments