Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

HTTP status absent from "Completed..." log line when exception occurs

#6333

If an exception occurs while processing an action, the "Completed ..." log line will not contain the HTTP status code.

To reproduce:

  1. Create a new Rails application.
  2. Create a controller, with an action like:
  def index
    raise "this is a bug"
  end

Actual Results: You will see the log line like this:

Completed in 0ms

Expected Results: Normally, this line would contain the HTTP status code immediately following "Completed":

Completed 500 Internal Server Error in 0ms

The patch I'm attaching just uses the payload[:exception] in this case, and looks up the status code in the same way as it is looked up elsewhere (like in rescue_action_locally and rescue_action_in_public in actionpack/lib/action_dispatch/middleware/show_exceptions.rb).

I've included a unit test as well. Assigning to José since it looks like he has signed off on other LogSubscriber changes.

Reported by Doug Fales · January 25th, 2011 @ 05:24 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: none