AnsweredAssumed Answered

MDC Log4j for Activiti Delegate Classes

Question asked by spark2 on Apr 16, 2014
Latest reply on Apr 22, 2014 by jbarrez
We are using Log4j MDC for adding custom key-value pairs to be logged so that we can track each request in multi-threaded environment. For each web request we log request id (System nano sec + random number).

When application calls activiti workflow which in turn calls JavaDelegate, this MDC keys are lost and are not logged by Log4j. After troubleshooting I found that MDC are not passed to threads started by Thread Pool Executor. Activit is using thread pool executor for starting job threads.

What is the best way to address this? I would like MDC to be logged from JavaDelegate classes.

Environment: IBM WebSphere 7, Java 6, Activiti 5.12, Log4j 1.2.x

Outcomes