Section "Logging"

useSerilog

    <entry key="useSerilog" type="System.Boolean" default="false"></entry>

Can be used to enable the Serilog based logging.

If Serilog is enabled the "old" logging mechanism / format is disabled. The Serilog log files cannot be read with Ulsviewer!

useKenaflowLoggerFile

<entry key="useKenaflowLoggerFile" type="System.Boolean" default="true"></entry>

Here you can decide if you want to use the kenaflow log file write to write log files on disk.

This can be used instead of or in parallel to useSerilog.

useKenaflowLoggerConsole

<entry key="useKenaflowLoggerConsole" type="System.Boolean" default="true"></entry>

This setting enables or disables the kenaflow internal console logger. - If running kenaflow a console application you see log messages in the console window.

You can use this instead of or in parallel with useSerilog and useSerilogConsoleLogger

useSerilogLoki

<entry key="useSerilogLoki" type="System.Boolean" default="False" comment="if TRUE kenaflow sends logs to Grafana Loki"></entry>

If useSerilog is enabled you can use this setting to send log messages to Grafana Loki.

useSerilogJsonfileLogger

<entry key="useSerilogJsonfileLogger" type="System.Boolean" default="False"></entry>

When useSerilog is enabled, then kenaflow creates JSON files from log messages using Serilog.

useSerilogTextfileLogger

<entry key="useSerilogTextfileLogger" type="System.Boolean" default="False"></entry>

When useSerilog is enabled, then kenaflow creates text files from log messages using Serilog.

useSerilogConsoleLogger

<entry key="useSerilogConsoleLogger" type="System.Boolean" default="False"></entry>

When useSerilog is enabled, then kenaflow writes log messages to the console.

serilogBaseTemplateConsole

    <entry key="serilogBaseTemplateConsole" type="System.String" default="[{Level}] {Message}{NewLine}{Exception}"></entry>

"Output template" for the Serilog Console Sink.

serilogBaseTemplateFile

    <entry key="serilogBaseTemplateFile" type="System.String" default="[{Level}] {Message}{NewLine}{Exception}"></entry>

"Output template" for the Serilog File Sink.

serilogTemplate

    <entry key="serilogTemplate" type="System.String" default="{TS:HH:mm:ss} {Process} {Event} {ThreadId} {Correlation} {Text:l}"></entry>

serilogTemplateForAdditionalProperties

<entry key="serilogTemplateForAdditionalProperties" type="System.String" default=" {OM} {@P}"></entry>

For use with Serilog.

serilogLokiAddress

<entry key="serilogLokiAddress" type="System.String" default="http://localhost:3100" comment=""></entry>

For use with useSerilogLoki.

minConsoleLogLevel

    <entry key="minConsoleLogLevel" type="System.Int32" default="2" comment="0=debug, 1=output, 2=verbose, 3=warning, 4=normal, 5=error"></entry>

"0=debug, 1=output, 2=verbose, 3=warning, 4=normal, 5=error"

Specifies the severity of log messages that are shown in the console window - if it is visible.

Possible Values:

Value Severity
0 Debug
1 Output
2 Verbose
3 Warning
4 Normal
5 Error

minFileLogLevel

    <entry key="minFileLogLevel" type="System.Int32" default="0" comment="0=debug, 1=output, 2=verbose, 3=warning, 4=normal, 5=error"></entry>

Specifies the severity of log messages that are written to the log file.

Value Severity
0 Debug
1 Output
2 Verbose
3 Warning
4 Normal
5 Error

dontLogIfMainWindowIsHidden

    <entry key="dontLogIfMainWindowIsHidden" type="System.Boolean" default="true" comment="if the kenaflow process window is hidden no log info is written to the console"></entry>

This disables the log output to the console window if it is not visible.

This happens if the Windows session of the user is non-interactive - e.g. for a service account - or if the console window was minimized.

If this setting is "TRUE" and the console window is hidden log messages will not be written to the console window for performance reasons.

logDir

    <entry key="logDir" type="System.String" default=".\log"></entry>

Specifies the directory where the logs are stored. For relative path specifications, the "ProgramDataFolder" is used as root.

logEnabled

    <entry key="logEnabled" type="System.Boolean" default="true"></entry>

Indicates whether the log is activated. If "FALSE", no log files are written to the hard drive or to the console window.

logOnlyMainProcess

    <entry key="logOnlyMainProcess" type="System.Boolean" default="true"></entry>

Specifies whether only the main process writes log files to the hard disk or also subprocesses that are started by the main process.

logMemMaxAge

    <entry key="logMemMaxAge" type="System.Int32" default="3600" comment="seconds"></entry>

Log messages that are displayed in the console remain in the memory of the kenaflow processes. Here you can specify after how many seconds these data can be discarded. Only the oldest data is deleted.

logFileMaxAge

    <entry key="logFileMaxAge" type="System.Int32" default="14" comment="days"></entry>

Specifies the number of days that the log files are to be kept.

logCleanupRunner

    <entry key="logCleanupRunner" type="System.Int32" default="120" comment="in seconds. Amount of time before cleanup runs."></entry>

Log messages are queued in memory before they are displayed in the console window (if the process is visible) and before they are written to disk (if enabled).

There is a sub process that cleans up the used memory. This setting here specifies how often the cleanup should run.

logfileCleanupRunner

<entry key="logfileCleanupRunner" type="System.Int32" default="3600" comment="in seconds. Amount of time before log file cleanup runs."></entry>

This setting controls how often log files are cleaned off.

logCleanupRunner

    <entry key="logfileCleanupRunner" type="System.Int32" default="3600" comment="in seconds. Amount of time before log file cleanup runs."></entry>

Log files on disk will grow and can be large! 200MB per hour are more than possible! Here you specify how often kenaflow checks old log files on disk. It will remove old log files that are older than logFileMaxAge days.

logFCE

    <entry key="logFCE" type="System.Boolean" default="false"></entry>

This can be used to determine whether "First Chance Exceptions" should be logged. These are exceptions in the program code that occur but do not necessarily represent errors. An exception handled in the program code is no cause for concern. Therefore, the storage of this information is normally superfluous.

logOutput

    <entry key="logOutput" type="System.Boolean" default="false"></entry>

Objects in the PowerShell pipeline that reach the top execution level of kenaflow (outside workflow scripts) can be serialized to the log.

sendOutputToMainProcess

    <entry key="sendOutputToMainProcess" type="System.Boolean" default="false"></entry>

PowerShell cmdlets often return values. Normally these return values are stored in variables. But if there is no "receiver" for the data it is written to the PowerShell pipeline. kenaflow will get this data on the last level of PowerShell execution.

This setting here specifies whether this return values (objects) are shown in the log or not.

logfileLockTimeout

    <entry key="logfileLockTimeout" type="System.Int32" default="500" comment="in milliseconds"></entry>

Each process tries to write log messages to the unified log file. This is handled by a subsystem of each kenaflow process and should not take long. During write the log file is locked.

The setting here specifies how long the log-writing sub system should wait for the lock before doing other things. If is really fails the process will keep the log in memory and will retry to write it later.

logCleanupThreadLogBlocks

    <entry key="logCleanupThreadLogBlocks" type="System.Int32" default="60" comment="in seconds. Amount of time before cleanup runs."></entry>

Functional parts of the software are grouped into logical blocks. kenaflow tries to group log messages in the same way, e.g. for detailed log analysis.

Each logical block gets a number, assigned at runtime. A sub system cleanup this up. The setting here specifies the amount of time (in seconds) between two cleanup attempts.

heartbeatMessageInLog

    <entry key="heartbeatMessageInLog" type="System.Boolean" default="false"></entry>

If enabled on each heartbeat communication a message is written to the log with level 'Debug'.

garbageCollectionMessageInLog

    <entry key="garbageCollectionMessageInLog" type="System.Boolean" default="false"></entry>

If enabled on each .NET garbage collection cleanup request a message is written to the log with level 'Debug'.

disableStacktrace

    <entry key="disableStacktrace" type="System.Boolean" default="false"></entry>

If enabled the .net Stack Trace is included in exception log messages.

exceptionAsJsonToConsole

<entry key="exceptionAsJsonToConsole" type="System.Boolean" default="false"></entry>

If $true all exceptions are logged to the console as JSON strings.

useMailHashing

    <entry key="useMailHashing" type="System.Boolean" default="true"></entry>

This enables / disables the hash based flood protection for error mails.

mailhashDir

    <entry key="mailhashDir" type="System.String" default=".\mailHash"></entry>

Folder for mail hash files. Full path or relative path to ProgramDataFolder setting in global configuration.

mailhashIntervals

    <entry key="mailhashIntervals" type="System.String" default="5,10,15,20,30,35,60" comment="comma separated list of minutes between identical mails"></entry>

A comma separated list of minute intervals.

Each value must be greater to the previous one!

disableRerCheckLog

<entry key="disableRerCheckLog" type="System.Boolean" default="true"></entry>

Used for debugging purpose.

disableAssemblyResolveLog

<entry key="disableAssemblyResolveLog" type="System.Boolean" default="true"></entry>

Used for debugging purpose.

logBeginEndCmdlet

<entry key="logBeginEndCmdlet" type="System.Boolean" default="false"></entry>

Used for debugging purpose.

Full Section Default

<section name="logging">
  <entry key="useSerilog" type="System.Boolean" default="false"></entry>
  <entry key="useKenaflowLoggerFile" type="System.Boolean" default="true"></entry>
  <entry key="useKenaflowLoggerConsole" type="System.Boolean" default="true"></entry>
  <entry key="useSerilogLoki" type="System.Boolean" default="False" comment="if TRUE kenaflow sends logs to Grafana Loki"></entry>
  <entry key="useSerilogJsonfileLogger" type="System.Boolean" default="False"></entry>
  <entry key="useSerilogTextfileLogger" type="System.Boolean" default="False"></entry>
  <entry key="useSerilogConsoleLogger" type="System.Boolean" default="False"></entry>
  <entry key="serilogBaseTemplateConsole" type="System.String" default="{Message}{NewLine}{Exception}"></entry>
  <entry key="serilogBaseTemplateFile" type="System.String" default="{Message}{NewLine}{Exception}"></entry>
  <entry key="serilogTemplate" type="System.String" default="[{LogLevel:l}] {TS:HH:mm:ss} {Process} {Event:l} {ThreadId:l} {Correlation} {Text:l}"></entry>
  <entry key="serilogTemplateForAdditionalProperties" type="System.String" default=" {OM} {@P}"></entry>
  <entry key="serilogLokiAddress" type="System.String" default="http://localhost:3100" comment=""></entry>
  <entry key="minConsoleLogLevel" type="System.Int32" default="2" comment="0=debug, 1=output, 2=verbose, 3=warning, 4=normal, 5=error"></entry>
  <entry key="minFileLogLevel" type="System.Int32" default="0" comment="0=debug, 1=output, 2=verbose, 3=warning, 4=normal, 5=error"></entry>
  <entry key="dontLogIfMainWindowIsHidden" type="System.Boolean" default="true" comment="if the kenaflow process window is hidden no log info is written to the console"></entry>
  <entry key="logDir" type="System.String" default=".\log"></entry>
  <entry key="logEnabled" type="System.Boolean" default="true"></entry>
  <entry key="logOnlyMainProcess" type="System.Boolean" default="true"></entry>
  <entry key="logMemMaxAge" type="System.Int32" default="3600" comment="seconds"></entry>
  <entry key="logFileMaxAge" type="System.Int32" default="14" comment="days"></entry>
  <entry key="logCleanupRunner" type="System.Int32" default="120" comment="in seconds. Amount of time before cleanup runs."></entry>
  <entry key="logfileCleanupRunner" type="System.Int32" default="3600" comment="in seconds. Amount of time before log file cleanup runs."></entry>
  <entry key="logFCE" type="System.Boolean" default="false"></entry>
  <entry key="logOutput" type="System.Boolean" default="false"></entry>
  <entry key="sendOutputToMainProcess" type="System.Boolean" default="false"></entry>
  <entry key="logfileLockTimeout" type="System.Int32" default="500" comment="in milliseconds"></entry>
  <entry key="logCleanupThreadLogBlocks" type="System.Int32" default="60" comment="in seconds. Amount of time before cleanup runs."></entry>
  <entry key="heartbeatMessageInLog" type="System.Boolean" default="false"></entry>
  <entry key="garbageCollectionMessageInLog" type="System.Boolean" default="false"></entry>
  <entry key="disableStacktrace" type="System.Boolean" default="false"></entry>
  <entry key="exceptionAsJsonToConsole" type="System.Boolean" default="false"></entry>
  <entry key="useMailHashing" type="System.Boolean" default="true"></entry>
  <entry key="mailhashDir" type="System.String" default=".\mailHash"></entry>
  <entry key="mailhashIntervals" type="System.String" default="5,10,15,20,30,35,60" comment="comma separated list of minutes between identical mails"></entry>
  <entry key="disableRerCheckLog" type="System.Boolean" default="true"></entry>
  <entry key="disableAssemblyResolveLog" type="System.Boolean" default="true"></entry>
  <entry key="logBeginEndCmdlet" type="System.Boolean" default="false"></entry>
</section>