Separate log files for different threads

Hello, I am wondering if it is possible to separate logging based on thread names? I would like logs generated by every thread to go into distinct log files, one log file per thread e.g FILE-${thread}.log. I know that I can have all threads write to a single log file and then grep on thread name, but want to know if there is a better approach. I have tried SiftingAppender and put the thread name into the MDC in each thread, but it didn't work. Thanks

SiftingAppender should work. Could you post your config? The code you used to set the thread name in the MDC could also be useful. On 10.10.2010 14:38, Cyber Jack wrote:
Hello,
I am wondering if it is possible to separate logging based on thread names? I would like logs generated by every thread to go into distinct log files, one log file per thread e.g FILE-${thread}.log. I know that I can have all threads write to a single log file and then grep on thread name, but want to know if there is a better approach.
I have tried SiftingAppender and put the thread name into the MDC in each thread, but it didn't work.
Thanks
participants (2)
-
Ceki Gulcu
-
Cyber Jack