[Pythomnic3k-questions] send an email when error is logged
Brought to you by:
targeted
|
From: Egidijus | C. <ez...@ca...> - 2017-02-10 22:20:41
|
Hello, I have a cage set up which uses few interfaces/resources (smpp, http). I would like to be notified by email if there are any level 1 (error) events on the cage (if http request times out, smpp bind fails and etc.). I have a module ready for sending email, which works fine when calling pmnc.emailer.send() from within the cage. Is there a way to attach it to logger somehow? I've tried to modify log() function in both startup.py and module_loader.py (_log() in there), but did not get it working. Not that it'll be a good way to achieve my desired functionality, anyway :) Also I'm thinking on just scanning log file with schedule interface each second for ERR lines. But this would be not the most accurate method. I'm looking now in config_resource_callable.py, but not sure yet if it will help me somehow. Could someone, please, advise me on how I should do this? Thank you for any feedback and for this great framework! |