[logback-user] Separate log files for different threads

Ceki Gulcu ceki at qos.ch
Mon Oct 11 17:36:33 CEST 2010


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
>




More information about the Logback-user mailing list