logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ysuneelreddy" <sre...@smarteinc.com>
Subject RE: Different client's log file?
Date Thu, 10 Aug 2006 07:48:21 GMT
Hi for this purpose use MDC & NDC
See details more 
Use key & values in MDC

-----Original Message-----
From: Javier Gonzalez [mailto:jagonzal@gmail.com] 
Sent: Thursday, August 10, 2006 10:04 AM
To: Log4J Users List
Subject: Re: Different client's log file?

On 8/9/06, wolverine my <wolverine.my@gmail.com> wrote:
> One or  more clients connecting to the server. How can we log the
> message into different client's log files?
>
> E.g. when there are client X, Y, Z connecting to the server. The
> messages will be logged into X.log, Y.log and Z.log.
>
> This will be easier for us to debug when one client encounter problem.

If the clients' names (every possible one) are known beforehand, you
can create an appender for each client, and log to a logger named
after the client - create your loggers as
"Logger.getLogger(client.getName())" and attach an appender to each
possible name.

-- 
Javier González Nicolini

---------------------------------------------------------------------
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


Mime
View raw message