<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MDC Logging from methods called with Spring expression in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233887#M187017</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Warper&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot for your pointers, that really helped. I've set up a listener which invokes the puMDCExecution according to the event which has been triggered the listener. That seems to work, but I'm not sure yet whether this also holds when multiple workflows are running in parallel. I'll yet have to figure that out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again and regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Juerg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Sep 2016 18:25:25 GMT</pubDate>
    <dc:creator>jritter</dc:creator>
    <dc:date>2016-09-14T18:25:25Z</dc:date>
    <item>
      <title>MDC Logging from methods called with Spring expression</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233885#M187015</link>
      <description>Hi everybodyI am wondering whether it is possible to log the Activiti MDC Attributes in Log messages which are generated by our own code which is called by a Service Task. I've followed the instructions in the Activiti User Guide (http://www.activiti.org/userguide/#MDC), and the keys are showing up</description>
      <pubDate>Tue, 13 Sep 2016 16:47:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233885#M187015</guid>
      <dc:creator>jritter</dc:creator>
      <dc:date>2016-09-13T16:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: MDC Logging from methods called with Spring expression</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233886#M187016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Juerg!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Activiti engine sources (I scanned community edition version 5.20)&amp;nbsp; contain only 1 file file directly working with MDC: org\activiti\engine\logging\LogMDC.java &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's used in few cases of exception handling. Something like this appears in catch blocks:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LogMDC.putMDCExecution(execution);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are no calls of MDC, LogMDC in engine apart from exceptions…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is also MDC context clearing function - LogMDC.clear(), which simply clears the whole MDC context (for current thread due to MDC context nature, but still the whole context instead of only activiti-related values).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can set up MDC context directly calling LogMDC.putMDCExecution with current execution in your every delegate(listener).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As you probably know, you should also clean up MDC context, since it is thread-local variable and threads will be reused by executioners or web-service engine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 10:02:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233886#M187016</guid>
      <dc:creator>warper</dc:creator>
      <dc:date>2016-09-14T10:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: MDC Logging from methods called with Spring expression</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233887#M187017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Warper&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot for your pointers, that really helped. I've set up a listener which invokes the puMDCExecution according to the event which has been triggered the listener. That seems to work, but I'm not sure yet whether this also holds when multiple workflows are running in parallel. I'll yet have to figure that out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again and regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Juerg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 18:25:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233887#M187017</guid>
      <dc:creator>jritter</dc:creator>
      <dc:date>2016-09-14T18:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: MDC Logging from methods called with Spring expression</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233888#M187018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Putting a listener is one solution, but you can (and you will) forget about it. I'm experimenting with CommandContextFactory, which can be set in ProcessEngineConfigurationImpl:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;class MDCCommandContextFactory extends CommandContextFactory {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public CommandContext createCommandContext(Command&amp;lt;?&amp;gt; cmd) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return new MDCCommandContext(cmd, processEngineConfiguration);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class MDCCommandContext extends CommandContext {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; public MDCCommandContext(Command&amp;lt;?&amp;gt; command, ProcessEngineConfigurationImpl processEngineConfiguration) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; super(command, processEngineConfiguration);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void performOperation(AtomicOperation executionOperation, InterpretableExecution execution) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LogMDC.putMDCExecution(execution);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; super.performOperation(executionOperation, execution);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; finally {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; LogMDC.clear();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should set MDC information for each and every action, shouldn't it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 10:42:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233888#M187018</guid>
      <dc:creator>mmalczewski</dc:creator>
      <dc:date>2016-09-21T10:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: MDC Logging from methods called with Spring expression</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233889#M187019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your comment featur, that looks like a promising solution as well! I'll surely have a look at this too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm curious, what kind of problems have you had with listeners?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 18:28:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233889#M187019</guid>
      <dc:creator>jritter</dc:creator>
      <dc:date>2016-09-21T18:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: MDC Logging from methods called with Spring expression</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233890#M187020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt; I'm curious, what kind of problems have you had with listeners?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You must remember to use them. Somebody will forget about it at some point, that's more than sure in larger projects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 12:44:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mdc-logging-from-methods-called-with-spring-expression/m-p/233890#M187020</guid>
      <dc:creator>mmalczewski</dc:creator>
      <dc:date>2016-10-19T12:44:12Z</dc:date>
    </item>
  </channel>
</rss>

