Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add email notification? #13

Open
cailiang9 opened this issue Nov 4, 2016 · 1 comment
Open

How to add email notification? #13

cailiang9 opened this issue Nov 4, 2016 · 1 comment

Comments

@cailiang9
Copy link

I found a way on web using logging handler: http://stackoverflow.com/questions/6182693/python-send-email-when-exception-is-raised . But I think we also need a delay(2m, 4m ... 1h to prevent too much notifications) and cache to send logging notifications to users. When the # (last sent logwarning) < 10 (system may be back to normal), the delay is reset to 2m again.

@rooterkyberian
Copy link

Seems like a logging problem, not a retry problem.

Not saying this is a way to implement it, but it can be using by implementing whatever logic you want for email buffering/aggregation/flood protection in flush method of custom logging handler.
You can use https://github.com/mikecharles/python-buffering-smtp-handler/blob/master/buffering_smtp_handler.py#L16 as inspiration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants