|
||||||||
|
This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira |
||||||||
_______________________________________________ logback-dev mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/logback-dev

Solved this problem using Lóránt Pintér's suggestion. Here is my groovy version:
MdcRetainingCallable() { this.context = MDC.getCopyOfContextMap() } @Override V call() { V answer = null Map originalContext = MDC.getCopyOfContextMap() MDC.setContextMap(context); try { answer = withMdc(); } finally { MDC.setContextMap(originalContext); } return answer } abstract protected V withMdc(); static MdcRetainingCallable cast(Closure c) { return ([withMdc: c] as MdcRetainingCallable) } }When I need to submit task to executorService I do following
threadPool.submit(MdcRetainingCallable.cast { my_task_code })