Open errrken opened 3 years ago
Just to confirm, an ExceptionReporter
that sends a message to Slack?
@lamby Yes, so here: https://github.com/lamby/django-slack/blob/9da57a889a6b943ae454c64e046ea76c19b4302c/django_slack/log.py#L52 it uses Django's ExceptionReporter.
So like a setting SLACK_EXCEPTION_REPORTER or something where you can reference your own if you want to (like my CustomExceptionReporter above). My aim is to filter out unnecessary sensitive data like request metadata etc when an exception occurs and posting to slack.
Or maybe there is a better way?
Not sure why you would need a SLACK_EXCEPTION_REPORTER
setting to do that. Could you not subclass django_slack.log.SlackExceptionHandler
(and modify its behaviour as you wish) and then configure your settings.LOGGING
to point to that version instead? I think I might be missing something here, though; it's been a long time since I used this exception handler.
Thanks for a great library.
It would be great if one could provide a custom ExceptionReporter. For example, I do not want to send data like settings and request_meta when exceptions happens. Right now I do:
and then override all of SlackExceptionHandler emit method just to change the ExceptionReporter class.
EDIT (lamby): Adding Markdown