Skip to main content
Kofax

How to enable default .NET TraceListener Core Worker logging

Question / Problem: 

How to enable default .NET TraceListner Core Worker logging.   Note: This will enable default .NET TraceListener, it is typically not useful for general CoreWorker troubleshooting purposes.

Answer / Solution: 

To enable .NET Core Worker logging perform the following:

1. Navigate to C:\Program Files\Kofax\TotalAgility\CoreWorker. Substitute the drive letter used for the KTA installation if different from the C: drive.

2. Backup the existing Agility.Server.Core.WorkerService.exe.config.

3. Open the Agility.Server.Core.WorkerService.exe.config, add the WithIO  to the LogMethodRegistration and uncomment the following lines:
   

<extension type="Agility.Server.Common.Logging.LogMethodWithIORegistration, Agility.Server.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d86c87abe4a71948" />

<system.diagnostics>

  <trace autoflush="true" indentsize="4">

   <listeners>

    <add name="KTALog" type="System.Diagnostics.TextWriterTraceListener" initializeData="D:\temp\KTALog.txt">

    </add>

   </listeners>

  </trace>

 </system.diagnostics>

3. Save the Agility.Server.Core.WorkerService.exe.config

4. 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.

5. Verify that the Core Worker service account has Full Control of the log location folder.
6. Restart the core worker service and the logs will be generated in D:\temp

To disable the logging simply stop the core worker, revert the config file and start the core worker again.

Important!

Do not leave the default .NET Core worker logging running unmonitored as it is only for short term tracing purposes!  The application event log will capture all concerning full-stack errors for troubleshooting, so it is unlikely you will need to enable this Core Worker .NET TraceListener.

Product Version
KTA 7.x