<?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: Integrating MDC Logging into all Logging Messages in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14375#M6315</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark,&lt;BR /&gt;I'm not super familiar with MDC logging in general, but I'm looking into the details a bit more to see if we can get this going.&lt;/P&gt;&lt;P&gt;-JEarles&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2017 16:57:42 GMT</pubDate>
    <dc:creator>jearles</dc:creator>
    <dc:date>2017-02-24T16:57:42Z</dc:date>
    <item>
      <title>Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14374#M6314</link>
      <description>Hello,&amp;nbsp;I would like to use a custom mdc&amp;nbsp;logging pattern and with my own&amp;nbsp;custom key and values to all messages logged within and outside the activiti engine&amp;nbsp;without adding each custom property to the LogMDC context in every delegate or action listener.I've implemented the solution suggested here:&amp;nbsp;&amp;nbsp;ht</description>
      <pubDate>Tue, 21 Feb 2017 15:44:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14374#M6314</guid>
      <dc:creator>miniscem</dc:creator>
      <dc:date>2017-02-21T15:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14375#M6315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark,&lt;BR /&gt;I'm not super familiar with MDC logging in general, but I'm looking into the details a bit more to see if we can get this going.&lt;/P&gt;&lt;P&gt;-JEarles&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:57:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14375#M6315</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-02-24T16:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14376#M6316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan. While I have been able to configure a custom command context to perform MDC logging, the command context appears only to be executing in custom java delegates. I received the same results when calling setCommandContext() on a ProcessEngineConfigurationImpl object from within a class implementing&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;ProcessEngineConfigurator - this class was configured using the ServiceLoader approach noted in the Activiti documentation.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 18:00:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14376#M6316</guid>
      <dc:creator>miniscem</dc:creator>
      <dc:date>2017-02-24T18:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14377#M6317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: #727174; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;Is this the best place to set the command context&lt;/STRONG&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;This does seem like the most logical location to place this; while there aren't really any requirements for the placement of this configuration, it just makes sense to place all of your ProcessEngine initializations in the same place.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;BR /&gt;Relating to your more recent comment, the ServiceLoader method is just a more modular approach - from my understanding, there shouldn't be any difference in how Activiti sees the implementation at runtime.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #727174; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;Are there any other places within the activiti engine startup lifecycle where I can set the MDC logging configuration so as to log with MDC context in &lt;EM style="border: 0px; font-weight: inherit;"&gt;all&lt;/EM&gt; logging messages?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I may be misunderstanding the implementation details of MDC, but it seems like - so long as the context parameters are set for the running thread, and the log4j conversion pattern is established, then all log4j messages should follow the modified pattern. You're saying that only the custom java delegates utilize the conversion pattern?&lt;BR /&gt;&lt;BR /&gt;-JEarles&lt;BR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 15:29:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14377#M6317</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-02-27T15:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14378#M6318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This gets to the core of the question: what is the 'correct' (or recommended) way to configure the process engine with our custom MDC logging properties?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My logging pattern is always followed (defined in log4j.properties) but the custom properties in my logging pattern need to be&amp;nbsp;configured so they can be injected in the log files. Here is my pattern:&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;log4j.appender.File.layout.ConversionPattern=&lt;/SPAN&gt;%d{ISO8601}&lt;SPAN class=""&gt; &lt;/SPAN&gt;%-5p&lt;SPAN class=""&gt; &lt;/SPAN&gt;[%c]&lt;SPAN class=""&gt; &lt;/SPAN&gt;%X{mdcAuthenticatedUser}/%X{mdcProcessDefinitionID}/%X{mdcProcessInstanceID}&lt;SPAN class=""&gt; &lt;/SPAN&gt;%m%n&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;The "//" part of the pattern always appear in the logs - so I know the MDC is pattern is working, but the values for variables: mdcAuthenticatedUser, mdcProcessDefinitionID, mdcProcessInstanceID do not (note: the first is a custom property being assigned in application logic, and the latter two are being assigned through Activiti's LogMDC class).&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;As of now, I'm trying to make these custom properties appear in every logging message by setting them up in a custom class that implements CommandContextFactory and then calling&amp;nbsp;setCommandContext()&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;on a ProcessEngineConfigurationImpl object from within a class implementing&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px;"&gt;ProcessEngineConfigurator. However, not all&amp;nbsp;messaged logged are appearing with my custom properties.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px;"&gt;What other strategies can I use to ensure that as many logging messages as possible contain values for my custom logging properties:&amp;nbsp;&lt;SPAN style="color: #3d3d3d;"&gt;mdcAuthenticatedUser, mdcProcessDefinitionID, mdcProcessInstanceID?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 20:35:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14378#M6318</guid>
      <dc:creator>miniscem</dc:creator>
      <dc:date>2017-02-27T20:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14379#M6319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just out of curiosity, have you debugged the LogMDC class to check that those MDC parameters are indeed being set with values? I'm mostly just wanting to make sure that all of the components are actually being loaded and utilized - if they are, then we can cross that off the potential problem list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another quick verification, the built in MDC parameters (processDefinitionId, processInstanceId &amp;amp; processBusinessKey) all work, is that correct? Or are those not showing up consistently either?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 21:36:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14379#M6319</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-02-27T21:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14380#M6320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The LogMDC class appears to be working correctly when it is called in when creating a command context. Activiti only references it from within 3 different classes: CommandContext, TimerCatchIntermediateJobHandler, AtomicOperationActivitiyExecute. Additionally, within these three classes, the LogMDC class is only used from within exception handler code - so it's evident that mapped diagnostic contexts are not used heavily from within the Activiti codebase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While this may be fine default activiti behavior, we have a requirement to call LogMDC.putMDCExecution() within our own code -- I *think* this can be accomplished by adding some configuration to the activiti process engine but I'm not 100% positive. As mentioned above, I am attempting to add this configuration by setting a custom command context at process engine configuration time. Within the command context, the&amp;nbsp;&lt;SPAN&gt;LogMDC.&lt;/SPAN&gt;&lt;SPAN&gt;putMDCExecution() will be called within the CustomCommandContext's&amp;nbsp;&lt;/SPAN&gt;performOperation() call.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 22:33:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14380#M6320</guid>
      <dc:creator>miniscem</dc:creator>
      <dc:date>2017-02-27T22:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Integrating MDC Logging into all Logging Messages</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14381#M6321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;performOperation method was removed in activiti 6. Any idea to put use pudMDCExecution in activiti engine?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2017 11:46:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/integrating-mdc-logging-into-all-logging-messages/m-p/14381#M6321</guid>
      <dc:creator>lwoznicki</dc:creator>
      <dc:date>2017-09-02T11:46:24Z</dc:date>
    </item>
  </channel>
</rss>

