If a sequence of execution for a user follows is handled by one thread (often 
the case in j2ee) then look at "fish tagging", MDC.  Log4j2 can put user and 
any other context in a thread Local object behind the scenes.

http://logging.apache.org/log4j/2.x/manual/thread-context.html

curt

-----Original Message-----
From: Michael Wechner [mailto:[email protected]] 
Sent: Wednesday, July 24, 2013 10:35 AM
To: Log4J Users List
Subject: Logging only particular users

Hi

We are using log4j for many years now for our open source CMS 
www.yanel.org and it works really great
and I really would like to thank everyone who contributed to log4j.

Over the years we are experiencing that more and more people are using 
our software, which is very nice, but
it also makes it harder to debug. Hence I had the idea that it would be 
nice if one could filter the log file, such that one
would see only the log statements generated by requests of a particular 
user.

I guess a simple way to accomplish this would be to add the user or 
session id to the log statement and then to grep for this user or 
session id. But it seems to me a bit crude and hence I wanted to ask if 
somebody might have tried something similar?

Thanks

Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to