rambulance: Any way to suppress Rails FATAL logging when handled by rambulance?
Hi @yuki24,
Thanks for creating this gem. I’m testing it out, and it looks really nice and seems to work well.
My question is with the following example / scenario:
The following curl command:
curl -D - -X PUT --data "not json" -H "Content-Type: application/json" http://localhost:3000
would generate a ActionDispatch::ParamsParser::ParseError
.
When I configure rambulance like this, it works great and returns a 400 as expected.
config.rescue_responses = {
'ActionDispatch::ParamsParser::ParseError' => :bad_request,
...
}
So far so good. One thing that I noticed however, even when requests are caught and handled correctly by rambulance, rails still logs a FATAL
message, which gets emailed automatically on production. It’s great to get an email for something that wasn’t handled, but when it is handled by rambulance, then I wonder if there’s a way to suppress this error from being logged and prevent an email from being sent out?
(I know it’s probably not strictly an issue with rambulance, but I would appreciate your help / thoughts about this)
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15 (4 by maintainers)
Commits related to this issue
- example for yuki24/rambulance#16 — committed to gingerlime/rambulance-example-app by deleted user 9 years ago
- example for yuki24/rambulance#16 — committed to gingerlime/rambulance-example-app by deleted user 9 years ago
I found a solution to keep my lograge logs clean… If you configure it to keep the original rails logs, then the unformatted messages go there instead.
With this setup the fatal message (not formatted)
goes into the rails log and lograge log includes only the well formatted message
I’m sort of happy. lol