This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Java Logging and concurrent users Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Java Logging and concurrent users" Watch "Java Logging and concurrent users" New topic
Author

Java Logging and concurrent users

Renato Losio
Ranch Hand

Joined: Nov 23, 2005
Posts: 99
Hello guys.

I would like to tag (and eventually filter) logs from different sessions and/or users in my web app. Is there a way to do that with Java Logging?

I used to do that with MDC & Log4j... is there anything similar in Java Logging so I can set up a filter in the web.xml?

Cheers,

Renato


Renato Losio - www.arsenio.it - renatoweb@arsenio.it
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Renato Losio:
Hello guys.

I would like to tag (and eventually filter) logs from different sessions and/or users in my web app. Is there a way to do that with Java Logging?

I used to do that with MDC & Log4j... is there anything similar in Java Logging so I can set up a filter in the web.xml?

Cheers,

Renato



You initialize the logging system and then make a session listener which in creation of a session will make a appender and add it to the logger.As soon as the session is destroyed ,you remove the session.You can do the same thing on login of the user.


Rahul Bhattacharjee
LinkedIn - Blog
 
Don't get me started about those stupid light bulbs.
 
subject: Java Logging and concurrent users
 
Similar Threads
Reg Front Controller Pattern...
LogManager?
How to enable logging with Xalan extension
session time out cheching using filter
using filters with struts