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 zze-pegase balg011 Bancharel Fabien DvSI/SIReS/GRE <pe...@rd.francetelecom.com> on 2001/10/23 13:59:21 UTC

new to log4j

Hello !

I've just discovered Log4J, and have already developed a Logger for my
needs.
I was surprised when I look at the documentation of the ASyncLog, and the
problem of not seeing last logs when application exits, coz I had worked on
the problem.

In my own Logger, I decided to limit IO operations, so every log arrives in
a BufferedOutputStream with a buffer size of 2048.

The Buffer is flushed when it is full, but I also have a DumperThread, which
flushes the buffer every xxxx ms. Typicaly, every 5 seconds.

For the looger being usable in a usual application and not only a server
application,
the thread has a maxIdleTime, so if there is no logs during too much time,
the dumperThread dies, so if the application finishes (the dumper thread is
the last thread remaining), it takes the maxIdle time to really finish.
If the dumperThread is dead, and if other logs arrives, a new Thread is
Build, an so on ...

I'm really satisfied of the performances of this method, and I don't lose
any log.

I just wanted to present these ideas, and maybe have opinions :)

Fabien B.

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