Quoting Elihu Smails <[EMAIL PROTECTED]>: > Could you point me to a resource where I could get more information on > how to do this. I don't have much experience with extending Log4J's > classes. >
It isn't a matter of extending any classes, but simply using what's available. I suggest you read the docs.... (search for "NDC") http://logging.apache.org/log4j/docs/manual.html There's a short explanation here as well http://www.onjava.com/pub/a/onjava/2002/08/07/log4j.html?page=3 http://wiki.apache.org/logging-log4j/NDCvsMDC http://logging.apache.org/log4j/docs/api/org/apache/log4j/NDC.html http://logging.apache.org/log4j/docs/api/org/apache/log4j/MDC.html Jake > Thank you. > > > On Tue, 22 Mar 2005 21:28:36 +0100, David J. M. Karlsen > <[EMAIL PROTECTED]> wrote: > > Elihu Smails wrote: > > > > >Is there a way to use one of the layouts/patterns in order to get the > > >username into the logs? I do not see this as an option in any of the > > >configurations and it seems like it would be really easy. > > > > > >Thank you. > > > > > > > > If it's the username of the user executing the java-process: use the > > system-property java.user (or java.username - can't quite remember right > > now). If it's a username in your application - use NDC (or MDC) and get > > it with %x in PatternLayout - or both in a combination! :-) > > > > --------------------------------------------------------------------- > > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
