Re: How to log each user to specific log file ?
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.