logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthys-Pearce, Andrew" <and...@agedwards.com>
Subject RE: Log one thread only
Date Fri, 18 Jan 2002 16:02:49 GMT
You could push a thread identifier onto the NDC just for the thread you're
interested in.  Then in a custom filter or appender you would need to check
the NDC for the desired thread identifier when deciding whether to log the
event.

Andy Matthys-Pearce
AG Edwards & Sons, Internet Services
x51587 ( desk )
490 7531 ( pager )

> -----Original Message-----
> From:	Klaus Mueller [SMTP:k.mueller@intershop.de]
> Sent:	Friday, January 18, 2002 8:22 AM
> To:	log4j-user@jakarta.apache.org
> Subject:	Log one thread only
> 
> Hi,
> 
> I use the log4j package with a multithreaded application server. I need to
> log the processing of one thread only. Each thread runs the same classes.
> I
> can not change the categories of this one interesting thread. I can only
> specify the name of the thread.
> 
> Question:
> Does anyone know how to limit the logging to one thread only?
> 
> Example:
> 
> I create 3 calculator threads:
> 
> ----
> t1|t2|t3 = new CalcThread();
> Logger.setLogThread(t2);
> 
> t1|t2|t3.start();
> ----
> 
> I need the log output of thread t2 only.
> 
> Thanks
> KLaus
> 
> --
> To unsubscribe, e-mail:
> <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:log4j-user-help@jakarta.apache.org>


***************************************************************************************
WARNING:  All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
***************************************************************************************

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message