Rails 3 not writing 500 status to log
I'm running a Rails 3.0.7 app with nginx and Passenger. I have a custom 500 page that is properly displayed when the app encounters an 500 internal error, however the actual '500' status is not being output to the logs. 开发者_JAVA百科
I'd like to be able to periodically grep the logs to find 500 errors, but I can't seem to figure out why the actual status is not being rendered. I've even looked through the Rails code, and everything looks fine. All other status codes are successfully logged.
Here is an error-free 200 response:
Completed 200 OK in 1265ms (Views: 1262.4ms | ActiveRecord: 69.6ms | Sphinx: 0.0ms)
Here is a 500 response:
Completed in 500ms
It appears that something is supposed to be there, but is not, so spaces are output instead.
Looks like this has been resolved in Rails master, but is not in the gem for 3.0.7 yet.
https://github.com/rails/rails/commit/7927fc2ff77543a0ab151ac1cb3d60318e2dfa68
精彩评论