FME Flow Debugging Toolbox: Logging Tools

Sanae Mendoza
Sanae Mendoza
  • Updated

Introduction

Log files are the best resource available for debugging workflows on FME Flow. In addition to the general translation details, we can use workspace tools and settings to record additional information to the job and automation log files.

This article contains instructions and tips for using additional logging tools for troubleshooting issues affecting FME Flow workflows and is best used for general investigation and diagnostics. Search keywords and errors on FME Community to find resources. Make sure to review the complete list of FME Flow Troubleshooting Guides when you identify the source of the issue. 


FMEtoolboxSmall.png
 

Debugging Disclaimer

Before you begin troubleshooting, carefully consider which tool will be most effective for solving the problem you are encountering in FME Flow. Not every tool or strategy will be useful or relevant to your issue. However, any progress is useful since troubleshooting is often a process of elimination.

The following sections may provide example directions for using each tool, but availability and instructions may differ between operating systems, deployment types, software versions, and other system factors. 

Always use caution or contact your FME Flow administrator when making any changes to your installation. 

 

Logging in “Debug Mode”

Debug logging records additional translation information to the job log. “Debug mode” is best used when an error has already occurred and you seek further information. For example, in the event of a web and database failure, “debug mode” will often record more detailed information about the request, response, and transaction to the job log.

 

Enable Debug Logging

Open the workspace in FME Workbench. In Workbench settings, turn on the Log Message’s debug filter. From Windows:

Main Menu > Tools > FME Options… > Translation > Log Message Filter > Log Debug


NOTE: Enabling “Log Debug” will only apply to the current workspace. All other workspace logs will be unaffected. 


Workbench Log Settings
Job Log Settings are configured within FME Workbench.

After “Log Debug” is turned on, republish the workspace to FME Flow. The next time the workspace is run,  a more detailed job log will be produced for this workspace. 
 
Keep in mind that most debug messaging is insignificant to a workflow. For example, nearly all messages labelled “BADNEWS ” can be ignored. It’s a good idea to disable debug logging when finished troubleshooting, as these messages can be misleading.
 

Inspecting Workflow Values with Logging Tools

Bad data can cause workflows to fail or produce unexpected results. We can add tools to our workflows that record the raw values in the log file. 

Logging can occur at the workspace or Automation level in FME Flow. Choose a workspace Logger transformer or automation Log action to capture and record values at specific points of a workflow.
 

Logging Workspace Values 

To log values at any point in a workspace, connect a Logger transformer to an existing output port. If you’re interested in just a specific attribute, select it in the Logger’s text editor.

Logger in Workbench
The “first name” attribute is selected in the Logger’s Log Message parameter. 
 
Republish the workspace to FME Flow and rerun the translation. In the job log, search for the “Logger” message. Are the attribute values expected or valid? 

LoggedMessage.pngThe value for the “first name” attribute is recorded in the job log, in addition to the feature’s other attributes. 

 

Logging Automation Values

To log values at any point in an Automation, connect a Log Action to a success or failure port. Use the Log Action’s Formatted Message drop-down menu to select a single upstream value or use the Text Editor to log several values.

LogDetails.png
A Log Action is connected to the “Success” output port of an Email Trigger. The drop-down menu allows us to select the incoming email attachment value. 
 
Trigger the automation and review the automation log. The logged value will follow the event. 

Automation Log Action Message
The Log Action recorded the email attachment path to the Automation Log. 
 

Manually Triggering an Automation

If you’re experiencing failures with one of the Automation Triggers, the Manual Trigger can be used to run an Automation on-demand and use sample event JSON data as input. This is useful for building or debugging an Automation that would otherwise need a spontaneous event to be triggered, like a webhook or directory watch. 
 

Logging Workspace Values in an Automation

You can use the FME Flow Automations Writer in order to pass translation values to the Automation log. 

LogDatasetInfo.png
A workspace writes a dataset and passes its name to an FME Flow Automation writer. Used in an Automation, that information can be passed directly to another action such as a Log. The drop-down menu allows us to select the correct attribute to record to the Automation log. 

See How I can use 'FME Flow Automation Writer' to pass data to other Workbench in FME Flow?
 

Python Logging

Python workflows can fail in FME Flow if the required modules are not found. Print the locations of Python dependencies directly to the job log to verify.

In the PythonCaller, add the following snippet to the script: 

import sys
print(sys.path)


The log file will now include a list of the system paths FME Flow is loading. Confirm the following:

  1. The expected interpreter is loaded.
  2. The correct directories are listed. 
  3. Navigate to the actual directories to confirm that modules, files, and folders are actually present. 

 

Additional Resources

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.