You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by JOSE L MARTINEZ-AVIAL <jl...@gmail.com> on 2009/12/04 20:57:59 UTC

Fwd: Concatenate DailyRollingFileAppender and SMTPAppender

Hello,
    Does anyone know if it's possible to "concatenate" two appenders? I have
setup a DRFA that rollovers at midnight, and I'd like it to send the file it
generates by mail to a certain mail address. I know I can modify the DRFA to
do that, but I wonder if such behaviour is already contemplated in the
log4j? Has anyone done something like this?

   thanks

JL

Re: Concatenate DailyRollingFileAppender and SMTPAppender

Posted by Curt Arnold <ca...@apache.org>.
The RollingFileAppender framework in the extras companion (http://logging.apache.org/log4j/companions/extras/index.html) would be a better starting point.  Much more designed for extensibility than DailyRollingFileAppender but offers the same features when properly configured.  You should be able to replace the rolling policy with an extended one that does what you want.

As for an existing solution, I'm not aware of one, but I wouldn't be surprised if someone pointed you to one in the new day or so.



On Dec 4, 2009, at 1:57 PM, JOSE L MARTINEZ-AVIAL wrote:

> Hello,
>    Does anyone know if it's possible to "concatenate" two appenders? I have
> setup a DRFA that rollovers at midnight, and I'd like it to send the file it
> generates by mail to a certain mail address. I know I can modify the DRFA to
> do that, but I wonder if such behaviour is already contemplated in the
> log4j? Has anyone done something like this?
> 
>   thanks
> 
> JL


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org