You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Percy Christian <pe...@manpowerandconsulting.com> on 2002/03/07 15:25:54 UTC

Extensions to Log4J

Hallo,

I am new to this kind of open source project communication and I am not sure
if this is the right place to handle this.
Anyway, I use the Log4J 1.1.3 version in my J2EE project for logging. Its
great but lacked one essential (for us) feature.
The system can be configured to use several appenders in parallel but hat I
needed was actually to use the Appenders in series. What I mean is that I
give a list of Appenders and I want that the appenders are tried in sequence
until one succeeds. So I first try to log to the Socket appender which
serves a central logger somewhere on the network. If it fails to deliver the
LogEvent then it try's the next Appender for example a File appender. and if
that fails as last resort I want to log it on the console.
I order for this to work I had to extend a lot of classes due to the fact
that the result of a write is not propagated upwards. I also extended all
the configuration classes to include this (multipleAppenderBehaviour) into
it so that one configure this. As I did not change any class of the Log4J
project itself (I each time created a derived class in which I implemented
the extension) it was quite a job, although I think it would be easy useful
and straight forward to implement it in the project itself.

I attach all the java classes I created to accomplish this task. Maybe
someone who has access to the projects source can integrate it or if someone
also needs the feature he can at least start from here on.


Greetings

Percy Christian