logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gallagher, Ron" <RG7...@att.com>
Subject RE: Third Party Appenders
Date Wed, 23 May 2007 17:13:20 GMT
Roger --

I'm not aware of an existing appender that does what you're asking, but
it wouldn't be difficult to create one.  Just create a class that
extends org.apache.log4j.AppenderSkeleton and override the
append(LoggingEvent) method.  In append(LoggingEvent), you'd run
whatever program you wanted via the java.lang.Runtime class. 

Ron Gallagher, AT&T Mobility

-----Original Message-----
From: Roger Varley [mailto:roger.varley@googlemail.com] 
Sent: Wednesday, May 23, 2007 1:00 PM
To: Log4J Users List
Subject: Re: Third Party Appenders

>
> You can accomplish what you want using the components that come
packaged
> w/ log4j.  Here's a log4j configuration that should accomplish your
> goals.  Explanations follow:
>

Ron, thank you very much for that very full and very clear
explanation. I can see how this will get me most of the way to what I
want by applying filters to the email appender. One last question if I
may, is there an appender available that will trigger the execution of
another java class when a message arrives. There is one message that
requires a re-start of the application and I would like to script the
restart based on the arrival of that message in the log (rather than
being woken in the middle of the night when a user can't log in).

I appreciate that this is not really what log4j was designed for, but
when I have no control over the application itself, this seems a
reasonably elegant way.

Regards
Gilbert

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


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


Mime
View raw message