On Fri, 2005-10-21 at 11:42 +0200, [EMAIL PROTECTED] wrote:
> The attached appender does exactly this job. It caches the last x events
> in memory and passes them to other appenders only in case of an logging
> event of a defined level (e.g. ERROR).
It's a nice idea, but there's some code formatting and initialization
things to clean up. Also, there's some potential performance issues...
Just as an example:
protected void appendInternalMessage( Object msg, long timestamp )
{
if( msg != null && msg.toString().trim().length() > 0 )
{
// use message as pattern
PatternLayout layout = new PatternLayout(
msg.toString() );
Calling msg.toString() and creating a new PatternLayout per message
seems a little costly. It's also wrong (like, what if %C appeared in
your message?)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]