I was wondering if it is possible to associate a login user ID with each log message (in a web based system). I want to record what a user does(e.g. post a message, view/update a record ...). Regards, Jason
We did something similar at my last job by wrapping the Logger (formerly Category) class in a wrapper that was used to perform all logging in the web app. Once you do that, you pretty much have control over all logging activities. hth, bear
I don't think log4j would have any web-specific code in it, which is what you want (you want an output format that includes information from an HttpSession, yes?) Seems to me you could extend the PatternLayout to add something for user... I don't know if this has been done already by someone else, have a look at the log4j mailing lists.
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me: