- 19 Sep 2024
- 2 Minutes to read
- Print
- DarkLight
Using the Log Step
- Updated on 19 Sep 2024
- 2 Minutes to read
- Print
- DarkLight
Overview
Logs provide a record trail for any issues encountered within the environment.
It is a best practice to include logging within a process in case any users/end-users are to occur an error during runtime.
The Log step is main step used to create logs when a Flow reaches a particular outcome path. The following example demonstrates how to use and configure the Log step within a Flow.
Configuration
The Log step comprises of three main settings: Type, Category, and Value input aka the log's Message.
Types
Also known as Levels, this setting declares the level of importance and severity of the error described in the log. The following default types are as follows:
Type Name | Description | Creates Log File |
---|---|---|
Info | This provides information to the user on an occurrence and is typically used outside of error tracking. | No |
Debug | This catches most exceptions that do not fall under the other categories. These are not shown by default; the Log Type must be set to Warning to view the Log Step message without altering the Logs. | No |
Warn | This tracks potential issues that do not impede the process from running. These are typically less critical issues. | Yes |
Error | This tracks when a process cannot complete properly. | Yes |
Fatal | This is an environment breaking level warning that stops a process (or multiple processes) from running. | Yes |
Category
This setting prompts for the log category that the log and its error may fall under. It recommended to make a log's category as easily identifiable as possible.
For example, default System log categories denote errors in specific logic within Decisions such as Forms, Rule Engine, ORM, etc.
Users may enter one of these pre-defined categories or create their own custom log categories. This is recommended for extensive processes name the Log step's category after the Flow producing the error such as "Payment Verification Flow".
Message
This setting prompts for the message the log provides once generated. The more descriptive message the better for any future troubleshooting. As with any other text input, information here may be set statically, dynamically, or with merge plain/HTML texts according to their appropriate mapping types.
To ensure your Log file is saved when choosing a Debug or Info Log Type, navigate to System > Settings > Logging Settings, then click and edit 'File System' and Enable 'Debug' 'Information' or 'Verbose' levels. Once this is done, a file will be saved based on these two types. For more information on Log files, please refer to Writing to Log Files, and Creating Custom Files.
Example
- From a Designer Project click the CREATE FLOW button on the Global Action Bar, then CREATE a new Flow.
- From the Flow Designer, attach a Log step from the Toolbox > FLOW MANAGEMENT > ERROR HANDLING, to the Done path of the Start step and the End step.
- From the Properties of the Log step, under SETUP LOG > Type, select the desired level (in this case Fatal).
- Under Properties > Category on the Log step, provide an easy identifier (such as the name of the Flow/Project/etc...)
- Under INPUTS, select SHOW EDITOR. Then, configure the message in the Merge Text Editor by inputting "Logged from Flow-". Afterward, expand the Flow Data tree on the right and Add the Flow TrackingId. Then, click SAVE.
- Save the Flow, then close with X.
- From the Designer Studio, right-click the Flow and select Run Flow.
- After the Flow runs, navigate to System > Administration > System Tools > Logging and view the Log of the Flow. Log Local File System LocationThis Log can also be viewed from the Decisions.Web.Core.txt file located in the Logs folder on the Local File System. If the default installation location was used for the environment, then this file can be located at C:\Program Files\Decisions\Decisions Server\Logs.