This project is archived and is in readonly mode.
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:
- Create a new Rails application.
- 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
-
Repository January 25th, 2011 @ 07:15 PM
- State changed from new to resolved
(from [7927fc2ff77543a0ab151ac1cb3d60318e2dfa68]) A patch so that http status codes are still included in logs even during an exception [#6333 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
https://github.com/rails/rails/commit/7927fc2ff77543a0ab151ac1cb3d6...
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
- 6333 HTTP status absent from "Completed..." log line when exception occurs (from [7927fc2ff77543a0ab151ac1cb3d60318e2dfa68]) A patch...