Skip to main content

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.

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)

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