How to I could set ‘attributes‘ to current Thread in Java, I want to set key-values and get the value in another place, but in the same Thread. like to this http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html
How to I could set ‘ attributes ‘ to current Thread in Java, I
Share
I do not think you can add attributes to any given thread in Java, but you could use a
ThreadLocalinstance to store any special information per thread.http://download.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html