Skip to main content
Kofax

How To Enable Transformation Server and Data layer Logging with daily log size management

Article # 3029412 - Page views: 163

Goal

This KB provides steps on how to Transformation Server and Data layer Logging with daily log size management to control log growth.   The FileLogTraceListener class provides automated maintenance capabilities to archive log files as needed, on a daily or per-application basis. This automatic archival functionality helps reduce the maintenance responsibilities for administrators.   The MaxFileSize and logFileCreationSchedule properties can be modified as per your requirements.

First Step - Update the relevant .config file(s) to use VB.NET listener

  • Navigate to your Transformation Server folder: (default location C:\Program Files\Kofax\TotalAgility\Transformation Server)
    • Substitute the drive letter used for the TS installation if different from the C: drive.
  • Backup the existing Kofax.CEBPM.CPUServer.ServiceHost.exe.config, so it can be reverted.
  • Open the Kofax.CEBPM.CPUServer.ServiceHost.exe.config file in a text editor such as Notepad++.
  • Navigate to the system.diagnostics section and replace with the following:

 <system.diagnostics>
    <trace autoflush="true" />
    <switches>
      <!-- Set the TraceLevelSwitch to any of the following values:
    
        Off - None
        Error - Only error messages
        Warning - Warning messages and error message
        Information  - Informational messages, warning messages and error messages.
        Verbose - Verbose messages, informational messages, warining messages and error messages.
        All - All messages.
      
    For more information about tracing options, see: http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx -->
      <add name="TraceLevelSwitch" value="All" />
    </switches>
    <sources>
      <source name="Kofax.CEBPM.CPUServer.ServiceHost" switchName="TraceLevelSwitch">
        <listeners>
          <clear />
          <add name="CPUServerLogTxt" />
          <add name="EventLogListener" />
        </listeners>
      </source>
      <source name="Kofax.CEBPM.CPUServer.Core" switchName="TraceLevelSwitch">
        <listeners>
          <clear />
          <add name="CPUServerLogTxt" />
          <add name="EventLogListener" />
        </listeners>
      </source>
      <source name="Kofax.CEBPM.CPUServer.Common" switchName="TraceLevelSwitch">
        <listeners>
          <clear />
          <add name="CPUServerLogTxt" />
          <add name="EventLogListener" />
        </listeners>
      </source>
      <source name="Kofax.CEBPM.DataLayer.Extensions" switchName="TraceLevelSwitch">
        <listeners>
          <clear />
          <add name="CPUServerLogTxt" />
          <add name="EventLogListener" />
        </listeners>
      </source>
    <source name="Performance" switchValue="TraceLevelSwitch">
        <listeners>
          <clear />
          <add name="CPUServerPerf" />
        </listeners>
      </source>
     <source name="Kofax.CEBPM.DataLayer" switchName="TraceLevelSwitch">
           <listeners>
             <clear/>
             <add name="DataLayerAll"/>
           </listeners>
         </source>
    </sources>
    <sharedListeners>
     <add name="EventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="KofaxTransformationServerService">
        <filter type="System.Diagnostics.EventTypeFilter" initializeData="Error" />
      </add>  
      <add name="CPUServerLogTxt" traceOutputOptions="ThreadId,DateTime" location="Custom" BaseFileName ="CPUServerLogTxt"
              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="CPUServerPerf" traceOutputOptions="ThreadId,DateTime" location="Custom" BaseFileName ="CPUServerPerf"
              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 ="DataLayerAll"
              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>
  </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 TS service account has Full Control of the log location folder.
  • Save the changes to the .config and restart the TS service 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 .config to disable the above logging.

 

  • Was this article helpful?