Skip to main content
Question

Change log file name with FMEWorkspaceRunner


Hello. I am running workspaces using FME Python API and the class FMEWorkspaceRunner, where I am currently using the method runWithParameters.

I would like to know how can I change the Log file name (and path) when running the workspace in this way. I saw in the documentation that runWithParametersAndDirectives have an example about change the log name, but it is not clear for me.

Thanks.

2 replies

takashi
Contributor
Forum|alt.badge.img+21
  • Contributor
  • December 6, 2016

Hi @diniz, the example described in the Python FME Objects API doc is not good. It seems to be C++ code and also be wrong :-(

Check this Python script snippet.

workspace = 'C:/tmp/your_workspace.fmw'
parameters = {'PARAM1':'VALUE1''PARAM2':'VALUE2'# pairs of parameter name and value
directives = {'LOG_FILENAME':'C:/tmp/out.log'# specify log file path
wr = fmeobjects.FMEWorkspaceRunner()
wr.runWithParametersAndDirectives(workspace, parameters, directives)

jamesadams
Contributor
Forum|alt.badge.img+3
  • Contributor
  • October 16, 2024
takashi wrote:

Hi @diniz, the example described in the Python FME Objects API doc is not good. It seems to be C++ code and also be wrong :-(

Check this Python script snippet.

workspace = 'C:/tmp/your_workspace.fmw'
parameters = {'PARAM1':'VALUE1''PARAM2':'VALUE2'# pairs of parameter name and value
directives = {'LOG_FILENAME':'C:/tmp/out.log'# specify log file path
wr = fmeobjects.FMEWorkspaceRunner()
wr.runWithParametersAndDirectives(workspace, parameters, directives)

Thanks for sharing this. Took me some time to find a working example.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings