How to log each user to specific log file ?
1 posts in topic
Flat View  Flat View

Posted By:   Nicolas_Derouault
Posted On:   Monday, January 24, 2005 09:08 AM

How to setup log4j to generate specific log files for each different user of my web application (tomcat) ?


Re: How to log each user to specific log file ?

Posted By:   neeraj_pandey  
Posted On:   Thursday, January 27, 2005 08:22 PM

Well, I am not aware of how to configure log4j in a way that a different file is created for each user. But, log4j provides Nested Diagnostic Context(NDC) using which context specific information is appended with the log which is unique for each client. The NDC is managed per thread as a stack of contextual information. Note that all of org.log4j.NDC's methods are static. Assuming that NDC printing is turned on, every time a log request is made, the appropriate log4j component will include the entire NDC stack for the current thread in the log output.

Hope it helps.

About | Sitemap | Contact