These links should be good for help. I read it carefully and I got how it works. Also, at the end of the techtip article they recommend to look at LogRecord and Charset classes in the JDK API and I looked at their sources to see how they are using ThreadLocal..
Though I found IBM's article with more insights.
subject: when are static ThreadLocal variables intialized