Creating Custom Log Files
  • 04 Apr 2022
  • 2 Minutes to read
  • Dark
    Light

Creating Custom Log Files

  • Dark
    Light

Article Summary

Overview

To help customize logging specifications within a Decisions environment, Administrators may define new log categories for easier tracking of errors via the Log step and Logging Settings JSON.

This file automatically updates when a new category is created.

For example, a user tracking Fatal and Error logs for a project may wish to create multiple custom logs for each segment of the project to better organize their troubleshooting process. 

Further, these settings can be used to to log specified Categories to their own individual files within the Local File System. This can also be helpful when managing multiple Projects where files need to be segmented, by allowing customers to have their own specific error files organized. The following document demonstrates how to create custom Log files.


Example

  1. In a Designer Project, create a new Flow. It will automatically open in the Flow Designer.
  2. In the Flow Designer, add a Log step from the Favorites section of the Toolbox after the Start step. Connect it to the End step.
  3. Select the Log step to view its Properties. Under Setup Log, change Type to Fatal and change Category to the desired category name e.g. "InsuranceProcess". Save and exit the Flow Designer.

  4. Run the Flow.
  5. Navigate to System > Settings > Logging Settings. Click on the File System to edit it.
  6. In the File System window dialog, select ADD next to Log Categories.
  7. In the Add Log Categories window dialog, search for the custom category entered in the Log step in the Category Name dropdown menu. Under Levels, pick the same level in the Log step e.g. Fatal. Set the Log to Own File checkbox to True. Select OK to confirm.
    Overlapping Category Names
    If the name of an already existing Log Category is used for the Log Step in a Flow and the Log To Own File Name settings is True, it will cause SHM to give an Error 1064 on restart attempt. If this error is received, the log category name already exists.

  8. Select OK in the File System dialog window. This confirms the creation of the custom log category along with its own log file.

Custom Log File Location

  1. After following the above steps, open the Decisions File System by navigating to C:\Program Files\Decisions\Decisions Server.
  2. Right-click on the LogSettings.json file and open it with a text editor such as Notepad++.

  3. This file displays multiple lines of LogCategorySettings for each available log category including new categories added by the Log step. Notice the new "InsuranceProcess" category under this setting. Exit the text editor.

  4. Open the Logs folder back in the file directory. Notice the newly created custom log file named after the category.
    Note on Matching Category/Levels
    Note that to create a unique Log based on a set Category the following must occur: 
    • LogToOwnFile must be set to True
    • The Category Name must match the Category set on the Log step
    • The Level must match the Type set on the Log step

    Failure to match either of these values will result in the Log Message writing to the Decisions.Web.Core. file only. 


    When the newly added InsuranceProcess.log file is opened, it will show the recorded log of the error that was hit when the Flow executed along with the message that was configured in the Log Step of the Flow.


    For further information on Settings, visit the Decisions Forum.


Was this article helpful?

What's Next