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
Best answer by takashi
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.
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.
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.
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.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.