Skip to main content
Question

Change log file name with FMEWorkspaceRunner

  • December 6, 2016
  • 2 replies
  • 32 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 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+5
  • Contributor
  • October 16, 2024

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.