You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, thanks a million maintaining this great gem!
Here's something I hope this gem to have as a new feature - I'm very happy to PR if that makes sense.
OPTION PROPOSAL (no breaking changes)
Just wanted to propose a new API that enables us to selectively ignore exceptions on notifier basis - something like:
Rails.application.config.middleware.useExceptionNotification::Rack,:ignore_notifier_if=>->(env,exception,notifier){exception.message =~ /^A Not-So-Important-Yet-Needs-To-Be-Logged Exception/ && \
notifier == :slack_notifier},:email=>{:email_prefix=>"[PREFIX] ",:sender_address=>%{"notifier" <[email protected]>},:exception_recipients=>%w{[email protected]},},:slack=>{:webhook_url=>"[Your webhook url]",:channel=>"#major_exceptions",}# Keep ignore_if option as it is now, so that it continues to be available for# lamda's with only two arguments
Or more simply, by using config
ExceptionNotification.configuredo |config|
config.ignore_ifdo |exception,options,notifier|
exception.message =~ /^A Not-So-Important-Yet-Needs-To-Be-Logged Error/ && \
notifier == :slack_notifierend# this also accepts two arguments as it used to do (notifier optional)config.ignore_ifdo |exception,options|
exception.message =~ /^Another Error That Needs To Be Totally Ignored/endend
Again, there is no breaking changes (back compatible) - current API is available as it is. Just wanted to make a new argument available.
Do you have any thoughts/advises on this..?
I'll be submitting a PR for this to show the details above with some decent tests attached - hope that makes sense!
USE CASE
We need this as we have multiple notifiers to serve for different purposes - we need our slack to alert only major incidents, but we still want to collect all the error logs just in case using other notifiers.
The text was updated successfully, but these errors were encountered:
I'd really like to see some way to do this. My first idea was to add ignore_if on a per-notifier basis. Global ignore_if for all notifiers + local ignore_if just for the current notifier:
Hello, thanks a million maintaining this great gem!
Here's something I hope this gem to have as a new feature - I'm very happy to PR if that makes sense.
OPTION PROPOSAL (no breaking changes)
Just wanted to propose a new API that enables us to selectively ignore exceptions on notifier basis - something like:
Or more simply, by using
config
Again, there is no breaking changes (back compatible) - current API is available as it is. Just wanted to make a new argument available.
Do you have any thoughts/advises on this..?
I'll be submitting a PR for this to show the details above with some decent tests attached - hope that makes sense!
USE CASE
We need this as we have multiple notifiers to serve for different purposes - we need our slack to alert only major incidents, but we still want to collect all the error logs just in case using other notifiers.
The text was updated successfully, but these errors were encountered: