Logging Settings
  • 05 Jun 2023
  • 6 Minutes to read
  • Dark
    Light

Logging Settings

  • Dark
    Light

Article summary

Advanced Content - Use Caution!
Contact a System Administrator to configure/adjust settings within this article to avoid platform errors and the risk of downtime.

Additionally, Settings.xml should be backed up before making any changes to the Logging Settings.

Overview

Through various methods, Administrators are provided options that allow the configuration of various logging parameters such as Log File Size, API Call Timeouts, and Database Timeouts that are recorded in the Decisions Logs.

These settings affect Logs that are recorded in the Logging Tool (System > Administration > System Tools). The following article covers the respective function and configuration of each Logging Setting.


Logging settings under Settings.xml

Logging Setting NameDefault ValueDescription
LogAPICallsTakingMoreThanSeconds5Prompts for a time threshold (seconds) that if an API call exceeds will then be recorded in the log.

LogCheckFieldTypesFalseWhen set to True, it verifies the types of fields used in WHERE clauses. Logs under CheckTypesLogger category at Debug, Warn, and Error if it finds mismatch levels
LogFileMaxSize10,485,760Prompts for the max file size (bytes) of a log.
The default 10,485,760 bytes equates to a maximum limit of about 10.49 MB.
The maximum configurable limit is maxInt32, aka 2,147,483,647 bytes, aka 2.14 GB.
LogFlowStepsTakingMoreThanMilliseconds1000Prompts for a time threshold (milliseconds) that, if a Flow step exceeds, will then be recorded in the log.
The default 1,000 value equals one second, so any steps taking longer than this will be in the log.
LogMaxBackups10Prompts for the maximum amount of backups a Log file can create of itself.
For example, the Decisions Logs folder may contain some log files with the same name but with a number after the name. These numbered logs are backups made before a new log is created.
LogSqlStatementsTakingMoreThanSeconds5Prompts for a time threshold (seconds) that if an SQL statement exceeds will then be recorded in the log.
CaptureAspNetLogsFalseEnables Kestrel Access Logging and generates Asp.net core Logs (file typically contains "Microsoft.AspNetCore" in the Logs/webserverlogs.
CaptureW3CLogsFalseEnables Kestrel Access Logging and generates W3C Logs in Logs/webserverlogs folder. If the setting is not present in Settings.xml, the following may be added to enable it:
<CaptureW3CLogs>true</CaptureW3CLogs> 
AspNetLogsFileCountLimit30The number of files retained for AspNet Log; this is used by both CaptureW3CLogs as well as CaptureAspNetLogs. 
AspNetLogsFileSizeLimit104857600The max size (bytes) of each individual AspNetLog file; is used by both CaptureW3Logs as well as CaptureAspNetLogs. 

Accessing and Editing Settings

Logging Settings can be accessed through one of the following methods:

  • via the Settings.xml file
  • via the System Settings in the Decisions Studio

Though many Settings can be accessed throughout each method, some Settings, such as "LogSQLStatementsTakingMoreThanSeconds", require additional configuration or adjustment via Settings.xml or DecisionsServerInstaller.exe.

Settings.xml File

  1. From C:\Program Files\Decisions\Decisions Server, open Settings.xml in a text editor (ex: Notepad).  
  2. Change the value(s) between the respective Logging open/close tags.

    For example, <LogMaxBackups>10</LogMaxBackups> may be changed to <LogMaxBackups>15</LogMaxBackups>.
  3. Save and close the text editor.
  4. Restart Decisions. 

System Settings 

  1. From the Studio, navigate to the Settings Folder
  2. Open Logging Settings
  3. A list of levels that define how the logs will be stored will be displayed. From the list, click the logging level and select Edit. In this case, File System was used.
  4. A dialog box will open, covering settings that can be used to define the log settings. Below is a breakdown of each property that can be found for any level. Once the settings have been defined, click OK.
    PropertyDescription
    Use Global SettingAvailable for any logging level that is not Global. If enabled, properties defined for the logging level will be overwritten by what is defined under the Global level.
    LevelsThis setting defines what information will be recorded within the logs. By default, only Warning, Error, and Fatal are enabled.

    VerboseProvides more information to the user

    DebugThis catches most exceptions that do not fall under the other categories.

    InformationThis information to the user on an occurrence is typically used outside of error tracking.

    WarningThis tracks potential issues that do not impede the process from running. These are typically less critical issues.

    ErrorThis tracks when a process cannot complete properly.

    FatalThis environment-breaking level warning stops a process (or multiple processes) from running.
    Log CategoriesSelecting Add will open another dialog box where log categories can be selected. If a category is defined, then only information from the related category will appear. 
    Log Usage DataAvailable only at the File System level, this field controls whether heartbeat data will be included in the Decisions.Web.Core logs. This field is enabled by default.
    Log File Max SizeAvailable only at the File System level. Defines the max file size for the log file. When the max size is reached for a log file, a new file will be generated.
    Log File Backup LimitAvailable only at the File System level.  Defines the max amount of generated log files stored on the file system. When the limit is reached, the oldest log file will be deleted from the File System.


Write logs to MSSQL and PostgresSQL

Decisions has the ability to write logs to MSSQL Server and Postgres databases.

Following are the additional settings to the above-mentioned Logging Settings.

MS SQL Server Settings
Use Local ConnectionWhen enabled, this will write the logs to the database to which Decisions is connected.
This option will be absent when Decisions is not using MS SQL server.
Connection StringDisabling Use Local Connection will expose this new field to add the connection string of the external database.
Table NameGive a unique Table Name to write the logs in the database.
Note: The table will be newly created.
Use an Encrypted ConnectionWhen enabled, the connection between the client and server will be encrypted only if the Root SSL certificate is installed.
Trust server CertificateWhen enabled, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust.
Postgres SQL Settings
Use Local ConnectionWhen enabled, this will write the logs to the database to which Decisions is connected.
This option will be absent when Decisions is not using a Postgres server.
Connection StringDisabling Use Local Connection will expose this new field to add the connection string of the external database.
Table NameGive a unique Table Name to write the logs in the database.
Note: The table will be newly created.

To validate the connection, navigate to the connected database server and find the table name given while configuring. Refer to the following image for reference.


LogSettings.json

The LogSettings.json file can be found in the C:\Program Files\Decisions\FileStorage\Primary\Settings folder in the File System

This file is used to control the behavior of Logging events at the Local level within the File System. Log Category Settings like Category Name or Level can be adjusted in this file.

After using the Log step, a new Category is automatically created in the LogCategorySettings. The given name for this Category is the name that was previously defined in the Properties tab of the Log step within the Flow


Enabling Web Server Logs in Self Hosted Environments

  1. Navigate to Settings.xml.
  2. Change the CaptureAspNetLogs value from false to true
  3. Save and close Settings.xml.
  4. Restart the service.

Enable Console Logging

In addition to viewing the logs within Decisions, Logs can be recorded and displayed in a console. This feature can be used for instances of Decisions running in containers, allowing logs to be viewed from the console window. 

To view logs within a console, the specified logging levels will need to be enabled, along with having Decisions initiated from a console if it is not currently hosted in a container. If Decisions is currently hosted as a container, then the first two steps can be skipped.

  1. Stop the Decisions Service.
  2. Launch a command prompt and navigate to the Decisions Server folder, and Run Decisions.Web.Core.exe.
  3. In Decisions, navigate to System > Settings > Logging Settings.
  4. Left click on Logging Settings, then right click on Console > Edit
  5. Enable or disable specific log levels. Levels that are enabled will appear in the logs.

Encrypting Session IDs for Logs

For versions 8.5 and above, Session IDs found in log files can be encrypted within a log file. This is done through the ObfuscateSessionIDInLogs property in the Settings.xml. However, this property will need to be manually added for versions upgrading to 8.5+.

  1. Navigate to Settings.xml.
  2. Locate ObfuscateSessionIDInLogs property and set the property to True
  3. Save and Restart the service.

Once the environment has been restarted, any logs which contain a Session ID will be encrypted.


For further information on Settings, visit the Decisions Forum.

Was this article helpful?

What's Next