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
{{ message }}
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.
We've started using the slack-bot-server in our product and really like what it does. One improvement I wanted to make was to have it log unhandled exceptions to an error logging component or service of choice, and being able to configure that. At the moment, the only thing the server does is writing errors to the log.
To workaround, I monkey patched the log_error method like below.
moduleSlackBotServer::Loggingdeflog_error(e, *args)message="#{e} - #{e.message}"message += " (#{log_string(*args)})"ifargs.any?# note I changes the log levels from the defaults here as well.SlackBotServer.logger.error("#{message}")SlackBotServer.logger.debug(e.backtrace.join("\n"))# do custom error reporting/handling here.Rollbar.error(e,message)endend
I went this route after looking at extending the gem sources in a way to make this less of a patch. But I didn't get to a solution that I felt good enough to submit a pull request.
Alternatives I tried were along the same line as what the gem does today in allowing you to override the SlackBotServer.logger or how you allow on_add and other hooks.
Has this been considered? Suggestions?
Based on feedback I'll be happy to work on what I started some more and submit a PR.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
suggestion / question
We've started using the slack-bot-server in our product and really like what it does. One improvement I wanted to make was to have it log unhandled exceptions to an error logging component or service of choice, and being able to configure that. At the moment, the only thing the server does is writing errors to the log.
To workaround, I monkey patched the
log_error
method like below.I went this route after looking at extending the gem sources in a way to make this less of a patch. But I didn't get to a solution that I felt good enough to submit a pull request.
Alternatives I tried were along the same line as what the gem does today in allowing you to override the
SlackBotServer.logger
or how you allowon_add
and other hooks.Has this been considered? Suggestions?
Based on feedback I'll be happy to work on what I started some more and submit a PR.
The text was updated successfully, but these errors were encountered: