File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes TOMCAT valve/global-filter setting MDC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "TOMCAT valve/global-filter setting MDC" Watch "TOMCAT valve/global-filter setting MDC" New topic
Author

TOMCAT valve/global-filter setting MDC

Veeresh Hubballi
Greenhorn

Joined: Apr 10, 2011
Posts: 2
I am trying to set MDC values in a global filter/Custom Valve.

MDC.put("user","testuser")

Why i am not able to see tha same getting appended in the logs.
I have included [%X{user}].But i get empty([]) in my logs.

And more over MDC.class.hashCode() in the valve/global filter and in servlet are showing different values even though Thread.currentThread().getname() is same.



 
Consider Paul's rocket mass heater.
 
subject: TOMCAT valve/global-filter setting MDC
 
Similar Threads
Logging in different servers
Java Logging and concurrent users
problem writing tomcat valve
How to configure Tomcat to log POST data?
Logging and session values