0

If your app raises an exception not caught by your app, then Rails will log it, using it's own rules for when to log, what to log (backtrace clean), how to format the log, etc. And will then present a 500 error message.

I am rescue'ing some exceptions myself, because I can recover from them with a better user experience than a generic 500 error.

However, they still represent unexpected conditions that should not have been possible, and I still want to log them -- I want to log them just like Rails does.

One would think there would be a method in Rails I can actually call myself to do this. Alternately, if needed, if I could find where in Rails does this, I could just copy and paste duplicate the logic to do it the same way.

But I'm having trouble finding what's what in Rails regarding this stuff at all. The code is confusing, spread accross middleware as well as Rails itself, different parts that look like they're going to tell me what I need but then don't seem to, etc.

Anyone have any ideas?

4

0 に答える 0