문제

I need to log messages from different user session into different log files. Also roll the log files which are X days old. How can I achieve that? Currently I'm using SLF4j along with Log4j. But I am willing to change my logging framework.

I tried using SLF4j MDC. But it works per thread basis. It looks like the same thread is servicing different user sessions.

Can someone help me with this?

도움이 되었습니까?

해결책

Finally figured it out. MDC is set per thread. So each time a request is made to the server, we need to set MDC which can be acheived using Servet/Portlet filters.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top