Skip to main content
Kofax

How To Enable Core Worker and Web Logging for Data Layer and Document Service (SDK) with daily log size management

This KB provides steps on how to Enable Core Worker and/or Web Logging for only Capture Document Service (SDK) with daily log size management
Article # 3030433 - Page views: 156

This KB provides steps on how to Enable Core Worker and/or Web Logging for only Capture Document Service (SDK) with daily log size management

Why..

Why would I want to only enable Core Worker and Web Logging for Data Layer and Capture Document Service (SDK)?     

There are many use cases for this type of logging, for example, perhaps, you have custom forms performing CDS calls like Delete Folder(), Merge() etc which are not captured in the Audit log or the audit log is disabled. The CDS logging would help trace the behaviour and automatically creates a new log daily, therefore can be enabled for longer. 

 

First part - update the relevant .config file(s) to use VB.NET listener

In the KTA web.cofig (web logging) or CoreWorker.config replace the <system.diagnostics> section with the below:

  • Navigate to C:\Program Files\Kofax\TotalAgility\Agility.Server.Web and/or C:\Program Files\Kofax\TotalAgility\CoreWorkerService
    • Substitute the drive letter used for the KTA installation if different from the C: drive.
  • Backup the existing .configs so it can be reverted.
  • Open the .config file in a text editor such as Notepad++.
  • Navigate to the system.diagnostics section.
  • Update the BaseFileName for either the Web or CoreWorker.  For example, the below config BaseFileName is for WEB.  In the CoreWorker config, use DocumentServiceCW, DataLayerCW, and DataLayerExtCW BaseFileNames:

<system.diagnostics>
<trace autoflush="true"/>  
            <switches>
          <add name="TraceLevelSwitch" value="All" />
        </switches>
        <sharedListeners>
          <!-- Event log trace listener. By default write only errors. -->
          <add name="EventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="TotalAgility">
            <filter type="System.Diagnostics.EventTypeFilter" initializeData="Error" />
          </add>
   
          <add name="DocumentServicesTxt" traceOutputOptions="ThreadId,DateTime" location="Custom" BaseFileName ="DocumentServiceWEB"
              logFileCreationSchedule="Daily" customLocation="d:\temp\" MaxFileSize="524288000"
              type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
            <filter type="System.Diagnostics.EventTypeFilter" initializeData="All" />
          </add>

          <add name="DataLayerAll" traceOutputOptions="ThreadId,DateTime" location="Custom" BaseFileName ="DataLayerWEB"
              logFileCreationSchedule="Daily" customLocation="d:\Temp\" MaxFileSize="524288000"
              type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
            <filter type="System.Diagnostics.EventTypeFilter" initializeData="All" />
          </add>   
          
            <add name="DataLayerExt" traceOutputOptions="ThreadId,DateTime" location="Custom" BaseFileName ="DataLayerExtWEB"
              logFileCreationSchedule="Daily" customLocation="d:\Temp\" MaxFileSize="524288000"
              type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
            <filter type="System.Diagnostics.EventTypeFilter" initializeData="All" />
          </add>
          
        </sharedListeners>
        <sources>
          <source name="Kofax.CEBPM.ThinClient.DocumentServices" switchName="TraceLevelSwitch">
            <listeners>
              <clear />
              <add name="EventLogListener" />
              <add name="DocumentServicesTxt" />
            </listeners>
          </source>
          <source name="Kofax.TotalAgility.DocumentServices" switchName="TraceLevelSwitch">
            <listeners>
              <clear />
              <add name="EventLogListener" />        
              <add name="DocumentServicesTxt" />
            </listeners>
          </source>
          <source name="Kofax.CEBPM.DataLayer.Extensions" switchName="TraceLevelSwitch">
        <listeners>
          <clear />
         <add name="DataLayerExt" />
        </listeners>
      </source>
       <source name="Kofax.CEBPM.DataLayer" switchName="TraceLevelSwitch">
           <listeners>
             <clear/>
             <add name="DataLayerAll"/>
           </listeners>
         </source>
        </sources>        
      </system.diagnostics>

  • In the Runtime section, add the following:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualBasic"  culture="neutral" publicKeyToken="b03f5f7f11d50a3a"/>
        <codeBase version="10.0.0.0" href="file://C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.5/Microsoft.VisualBasic.dll"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

  • Verify that the folder path for the log location exists. (d:\Temp in this example). I would ensure this drive is not operation critical (eg system drive) and has sufficient space.
  • Verify that the IIS Application Pool and/or Core Worker service account has Full Control of the log location folder.
  • Save the changes to the web.config file or Core Worker.config.  Updating the web.config will recycle the IIS app pool, however the Core Worker service will need to be restarted for the change to be applied.
  • Second part, replicate and revert

  • Replicate the behavior that is to be captured in the logging. The results will be in the log file specified in the path.
  • Revert to the previous .configs to disable the above logging

Important

This is not a long-term solution as it requires maintaining log files on each KTA WEB or APP server as it creates a new log daily.

As IIS logs using UTC, the generated DocumentServiceWEB-xxxx-xx-xx.log will use the UTC timezone.