Skip to main content

Hi

I am in the process of creating a bunch of workbenches and would like to use Python scripts to create a custom log file for each workbench, each with specific name and in specified location.

I would like to log only specific outputs, e.g. count of features failing geometry validation, Total count written, Total count failed etc..

Any suggestion what's the best practice to achieve this. Should I be using startup/shutdown scripts or python caller? I would also like to create the log file with a datestamp.

Thanks

Hi @sunsilk11, I think you can do that with shutdown Python script. See this document to learn about FME predefined global functions/variables which can be used in a shutdown script.

FME Workbench | FME Workbench | Working in the Navigator | Startup and Shutdown Python Scripts | FME_END_PYTHON

For example, you can know how many features were written through a global variable called "fme.featuresWritten".

Some other data occurring while the translation such as geometry validation result can be saved as Python global variables using a PythonCaller and then accessed in the shutdown script. The concrete way is different depending on where/how the information occurs.

Regarding datestamp, it would be easy to use the Python standard "datetime" module.


Reply