in reply to RFC: Module idea: Carp + controlled email

You seem to be mixing 2 pieces of functionality that I would seperate.

1. You want problems to get recorded somewhere.

2. You want to hear about problems that are happening.

I would solve your problem by making sure that everything was using some sort of centralized logging. I would then have a cron job that processes the logs and decides when to send you email based on it.

That way when something is borked, you won't have a thousand processes a minute trying to decide whether or not to send an email. You'll also have the opportunity to be able to summarize things in a more flexible way. For instance if you see that some obscure error happened, is it a priority or not? Maybe, maybe not. If you you get a message that it happened 1000 times in the last minute, is it a priority or not? You betcha!

Another, more subtle, benefit. What happens if you have your special logic and there is some system issue that causes an error when you send email? If you have each process be responsible for sending a message, it might generate an error, begin sending email, generate a second error, begin sending email, and get in an endless loop. With the log approach you won't have to worry about that nasty corner case.

  • Comment on Re: RFC: Module idea: Carp + controlled email