025978 Conditional debug logging for Watcher

    1.    Overview

Khaos Control have added functionality for capturing debug output from the Watcher, without just logging gigabytes of debug messages constantly.

.

    2.    Specification

Add functionality for capturing debug output from the Watcher, without just logging gigabytes of debug messages constantly.

 

1) Add an option to capture debug output (e.g. SQL executed with timestamps) to an in-memory list

2) Add an option for the Watcher client exe to pass debug messages back to the ASP.NET host, for it to log into it's own debug output

3) Add a command line parameter for the Watcher client exe to configure when to actually pass debug output on - based on execution time. So if call took > X ms then pass debug output back to host; otherwise, simply discard. That way we can log only the slow calls.

 

     3.    Configuration

An updated application will be provided with this functionality. The further configuration step required is:

 

3.1   HHT2 Appsettings JSON file.

An example of the  ‘WorkerArguments’ part of the Appsetting file is:

 

"WorkerArguments": "/HHT /ExceptionLog:C:\\Websites\\Testing_Empire\\WatcherEx.log /LogThreshold:10 /KLogSeverity:60",

 

The new part is the ‘/LogThreshold:10’.

Here the system will record any SQL query which takes 10 seconds or longer to complete within the log file.

 

    4.    Usage

After applying the above Configuration, typical steps for usage would include:

 

 

If any HHT2  (watcher) action takes longer than the specified ‘LogThreshold’ time in seconds, then the SQL for action is recorded in the log file.


Did you find this article helpful?