Logging Overview

Last Updated: 08/30/2018 Introduced in Version: 2.2

Overview

This tutorial demonstrates how to write into the Log file, manage Logs, and create custom categories for logs. You can use the Log step in the Decisions Flow Designer for debugging purposes. This step can be found in the Flow Designer  under Flow Management > Debugging.


Example:

In this example, create a simple Flow with a Log step.

In a Designer Folder begin by clicking Create Flow button on the Folder Actions Panel.

Then, Name the Flow and click Create to proceed to the Flow Designer.

 

In the Flow Designer, add a Log step from the Flow Management > Debugging category.

 

Connect the Log step to the End Step in our Flow. Click the Log step, then on the right side click the Properties tab.

The Type setting lets you configure a log level in descending order of importance: Debug, Info, Warn, Error, Fatal. By default the tool displays only the Warn, Error, and Fatal types under System > Administration > System Tools > Logging. For testing purposes, set the Type to Fatal.

 

The Category setting lets you set a category for your logs for easy identification. Often, best practice is to use the name of your Flow or project for the log category.

In the log viewer, Level and Category appear as follows:

 

Under Inputs, the Value property lets you configure the content of this Log. It can be either a constant value or dynamic data from the Flow. In this example use the setting Text Merge.Plain and click Show Editor to compose the text.

 

In the Merge Text Editor compose a simple message and add the FlowTrackingId value from Flow Data. Click SAVE to save and continue.

 

Save and close the Flow Designer.

Back in the Designer Folder, right-click the Flow and click Run Flow to run it.

To check the log, click System > Administration > System Tools > Logging.

 

The log is also written to the file system in  C:\Program Files\Decisions\Decisions Services Manager\Logs\Primary.txt (Note: the location may be different in the file system if you did not use default Decisions installation).

2017-02-10_165842

 

Open Primary Log file, find the Message from the Log step.

2017-02-10_170126

 

A custom category file is also created by default. Log Categories are powerful in organizing Log messages. Categories can be configured and created in the LogCategorySettings file that is located in C:\Program Files\Decisions\Decisions Services Manager\ folder.

2017-02-15_124338

 

In the LogCategorySettings file, notice a new category has been automatically created. The name of this category was set in the Properties tab of the Log step in our flow. In this file manually set the Log Levels or set logs in this category to be written to the separate file (changing the LogToOwnFileName from false to true).

2017-02-15_125122

 

For this example enable the new category to write to the separate file. (Note, you may need to change permissions settings to modify and save this file.)

2017-02-15_130049

 

To test this, return back to the Portal and run our Flow. To do this, right-click on the flow and click Run Flow.

 

Once the flow has run, navigate to the C:\Program Files\Decisions\Decisions Services Manager\Logs folder and locate ‘Logging Overview Flow’ log file that was created with the Log step in our Flow.

2017-02-15_131532

 

This file contains the Log message that was in the Primary log file previously.

2017-02-15_131629

 

Global logging settings can be configured in Settings.xml file that is located in C:\Program Files\Decisions\Decisions Services Manager\ folder.

2017-02-15_131846

 

You can also change logging settings in the Portal under System > Administration > System Tools Logging. This folder contains the Server Log Viewer and Client Log Viewer.

To change logging settings on this folder, right-click and click Server Log Categories > Enable/Disable.

 

Additional Resources