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.


In reply to Re: RFC: Module idea: Carp + controlled email by tilly
in thread RFC: Module idea: Carp + controlled email by pileofrogs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.