I am working on a suite of multi-threaded Java programs, each thread of which I have assigned a name to. When queried from from inside the program, each thread correctly reports its name. Log4j, using the "%t" formatting option, also correctly reports the thread names -- except the main thread for each application, which it reports simply as "main". Does anyone know why this should be, and if there is any way to coax log4j into reporting the correct thread name?
Asked
Active
Viewed 208 times
1
-
I had exactly the same issue, until I realized that I'm mistakenly calling the `run()` method on my thread objects, rather than the `start()` method. See [this discussion](http://stackoverflow.com/q/262816/459391). – Sadeq Dousti May 08 '17 at 05:31