DEV: Do not log `MimeNegotiation::InvalidType` to logster

This error is self-inflicted by  clients (often security-scanners attempting injection attacks on the Accept header). No need to log them. Rails itself defines this as a 'silent exception', but this doesn't entirely prevent it from being logged: https://github.com/rails/rails/blob/f2caed1e/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb#L39-L42
This commit is contained in:
David Taylor 2021-12-29 11:15:10 +00:00
parent 86505dd394
commit ad25e4103d
1 changed files with 5 additions and 1 deletions

View File

@ -33,8 +33,12 @@ end
if Rails.env.production?
Logster.store.ignore = [
# honestly, Rails should not be logging this, its real noisy
# These errors are caused by client requests. No need to log them.
# Rails itself defines these as 'silent exceptions', but this does
# not entirely prevent them from being logged
# https://github.com/rails/rails/blob/f2caed1e/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb#L39-L42
/^ActionController::RoutingError \(No route matches/,
/^ActionDispatch::Http::MimeNegotiation::InvalidType/,
/^PG::Error: ERROR:\s+duplicate key/,