- Updated on 10 Apr 2019
- 3 minutes to read
This tutorial demonstrates how to write into the Log file, manage Logs , and create custom categories for logs. You can use the Log stepin the Decisions Flow Designer for debugging purposes. This step can be found in the Flow Designer under Flow Management > Debugging .
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 default logging type is Warn
TheCategory 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:
UnderInputs, the Value property lets you configure the contentof 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).
Open Primary Log file, find the Message from the Log step.
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.
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 totrue).
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.)
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 .
This file contains the Log message that was in the Primary log file previously.
Global logging settings can be configured in Settings.xml file that is located in *C:\Program Files\Decisions\Decisions Services Manager* folder.
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 .