Skip to content

Instantly share code, notes, and snippets.

@jsimpson
Last active March 30, 2018 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsimpson/9ff223fb6947f7e07c26d2186bebf927 to your computer and use it in GitHub Desktop.
Save jsimpson/9ff223fb6947f7e07c26d2186bebf927 to your computer and use it in GitHub Desktop.
# application.rb:

config.exceptions_app = lambda do |env|
  exception   = env['action_dispatch.exception']
  params      = env['action_dispatch.request.parameters']
  request     = Rack::Request.new(env)
  status_code = ActionDispatch::ExceptionWrapper.new(env, exception).status_code
  
  Rails.logger.info [
    "Exception: #{exception}",
    "fullpath=#{request.fullpath}",
    "params=#{params}"
  ].join(" - ")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment