The previous replies assumed that when one of your scripts "keeps a log of its output", this means it is always appending to a single log file every time it runs (so the log file gets longer with every run). If that's what you meant, then one idea would be:
# check the size of the log before the main script starts # check the size again after the logging "sub" scripts are done # if the log has grown, # open it, seek to the original size (start of new data) # read everything that was appended on this run. # filter out anything that you know does NOT describe an error # mail the remainder to interested recipients.
On the other hand, it occurred to me that the script that logs its output might just be creating a new log file on each run, in which case the same strategy would work, without having to check the log file size first or seek to the start of the current output -- just read the whole log file.

The important thing is to start by identifying and removing the stuff that people really don't need to see; if some irrelevant stuff gets through, that's less of a problem than failing to identify and keep all the possible relevant data. And it'll be easier to add to the set of irrelevant patterns to be deleted as people get tired of seeing them...


In reply to Re: Error Handling by graff
in thread Error Handling by Anonymous Monk

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.