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 Mathijs Vogelzang <m_...@dds.nl> on 2004/01/30 22:50:51 UTC

Logging question

Hi,
I have a question about logging with log4j. I've used it over a prolonged 
period now and it helped me a lot tracking down bugs. My problem is that when 
components become a little more mature, I usually upgrade their log-level to 
WARN so that there's not a huge flow of logging messages of INFO and DEBUG 
statements. Sometimes however, an error still occurs, and those errors are 
often hard to reproduce. At such times the INFO and DEBUG messages that were 
logged right before the error would really come in handy to analyze the 
error. 
So my ideal scenario would be that INFOs and DEBUGs are kept in some temporary 
buffer of length say 100 messages and that they're all output once an error 
occurs and otherwise they keep getting overwritten by newer log events. Is 
this possible in log4j?
Best regards,
M. Vogelzang

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


Re: Logging question

Posted by Paul Smith <pa...@lawlex.com.au>.
The SMTPAppender has exactly the functionality you describe, and it's
darn useful for a production environment.

For the log4j 1.3 (currently only available from CVS) I believe Scott
Deboy has added an optional buffer to the SocketHubAppender, so if you
use a remote client such as Chainsaw v2, you can connect to the
SocketHubAppender and receive the last X events so you can see what
_was_ happening.

cheers,

Paul Smith
On Sat, 2004-01-31 at 08:50, Mathijs Vogelzang wrote:
> Hi,
> I have a question about logging with log4j. I've used it over a prolonged 
> period now and it helped me a lot tracking down bugs. My problem is that when 
> components become a little more mature, I usually upgrade their log-level to 
> WARN so that there's not a huge flow of logging messages of INFO and DEBUG 
> statements. Sometimes however, an error still occurs, and those errors are 
> often hard to reproduce. At such times the INFO and DEBUG messages that were 
> logged right before the error would really come in handy to analyze the 
> error. 
> So my ideal scenario would be that INFOs and DEBUGs are kept in some temporary 
> buffer of length say 100 messages and that they're all output once an error 
> occurs and otherwise they keep getting overwritten by newer log events. Is 
> this possible in log4j?
> Best regards,
> M. Vogelzang
> 
> ---------------------------------------------------------------------
> 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