I would like to receive an email, if anywhere in my application a Rails.logger.errror method is triggered.
I know about all these exception_notfiers, but Rails.logger.error is triggered without an exception as well in my application and these exception_notfier gems will not catch them.
Would be great if anybody could offer me a solution.
This is indeed an issue. Currently, our app logs to the standard Rails
logger sometimes, and to Data Dog sometimes -- these require two
different calls, and it is sometimes confusing when to use which.
This shouldn't be too much of a problem, since you can specify a new
logger for Rails.logger to use (and use per environment, if wanted).
As for having an email option, log4r seems more useful.
I would like to receive an email, if anywhere in my application a
Rails.logger.errror method is triggered.
I know about all these exception_notfiers, but Rails.logger.error is
triggered without an exception as well in my application and these
exception_notfier gems will not catch them.
Would be great if anybody could offer me a solution.
We used to do this via syslog - our hosting provider had a shell
script that tailed the syslog file containing entries relative to our
app and would email us anything of that level or above.
I'm afraid that was with a previous job so I no longer have access to
that but it is definitely doable
Until Joe down the street decides he wants to be as clever as you and
alias it to old_method and erase yours accidently, or until Marline
from up the street asks you why there are objects hanging around when
you mean to replace them. If you intend for :old_method to be an
object on it's parent then great more power to you, if you don't then
unbind the method and use define_method and be cleaner in your source
even if you are already being dirty by monkey patching.