This project is archived and is in readonly mode.

#6333 ✓resolved
Doug Fales

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

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

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.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages