hello, i was in a similar situation last year: i looked at
Log::Log4Perl and can do quite a lot of things.
Finally i ended with
Multiplexing log output: Log4perl of the poors in which you can find my best effort on multiplexing the log process.
Here the 'debuglevel' dispatch table is ordered in an incremental manner: you can modify to act in a different way to add a MAIL specification.
Take in count that the code is something experimental..
HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.