Last active
October 1, 2015 04:07
-
-
Save ingeniarius/1916625 to your computer and use it in GitHub Desktop.
Disable rails 4 asset log messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails::Rack::Logger.class_eval do | |
def call_app(request, env) | |
path = request.filtered_path | |
unless path.index("/assets/") == 0 | |
# Put some space between requests in development logs. | |
if development? | |
logger.debug '' | |
logger.debug '' | |
end | |
instrumenter = ActiveSupport::Notifications.instrumenter | |
instrumenter.start 'request.action_dispatch', request: request | |
logger.info started_request_message(request) | |
end | |
resp = @app.call(env) | |
resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) } | |
resp | |
rescue | |
finish(request) | |
raise | |
ensure | |
ActiveSupport::LogSubscriber.flush_all! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment