Skip to main content
Question

Parameters into log file

  • November 28, 2012
  • 6 replies
  • 92 views

lpalli
Contributor
Forum|alt.badge.img+10
How to log into the log file, not only on the Workbench log window, the workspace parameters used to start it?
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.

6 replies

david_r
Celebrity
  • November 29, 2012
Kathy is correct. In FME 2012 you will usually find it on line 7 (or thereabouts) in the log file.

 

 

David

nic_ran
Contributor
Forum|alt.badge.img+16
  • Contributor
  • November 29, 2012
The TCLCaller can be used to write non-published params.

sigtill
Supporter
Forum|alt.badge.img+25
  • Supporter
  • December 3, 2012
Also the PythonCaller can be used to publish all avalaible Published Parameters. More information here: http://fmepedia.safe.com/articles/How_To/Startup-and-Shutdown-Python-and-TCL-Scripts

kimo
Contributor
Forum|alt.badge.img+10
  • Contributor
  • December 4, 2012
I went looking for the parameters in my log files too, and they are not there, only in the interactive window. Maybe there is a parameter setting?

 

 

What is required is a way of getting all the parameters so that they can be used to create a batch file. I wanted a dozen of them, and I didn't want to run each workbench to get them in the interactive window.

 


lpalli
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • December 4, 2012
Thanks for the answers.

 

 

I tried the Startup script proposition and I'm able to log the parameters.

 

 

But all the parameters are returned in the FME_MacroValues global variable: published parameters, private parameters, ...

 

Any idea on how identify and log only the published parameters?

 

 

Another "small" problem is that the password are also present int the FME_MacroValues dictionary and it's in plain readable format. How identify a password parameter to avoid logging it?

lpalli
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • December 6, 2012
Finally I created a small Startup Python Script to log the Published Parameters also in the log file, the only limitation of this script is that I must add manually the list of parameters to publish to prevent to publish all the parameters, also the not published!

 

 

import fmeobjects

 

 

################################################################################

 

## Script to log the Published Parameters also in the log file, not only in the

 

## Translation Log Window.

 

##

 

## The list of ordered parameters to log must be manually adapted to the

 

## parameters of the workspace.

 

################################################################################

 

 

# Odered list of Published Parameters to be logged

 

parameters = ["DatabaseId", "DestDataset_FILEGDB", "abc"]

 

 

logger = fmeobjects.FMELogFile()

 

logger.logMessageString("Published Parameters:", fmeobjects.FME_INFORM)

 

keyValue = "    --{0} {1}"

 

notDefined = "    --{0} not defined (the parameters list into the Startup " + \\

 

    "Python Script must be corrected)"

 

for parameter in parameters:

 

    if parameter in FME_MacroValues:

 

        logger.logMessageString(keyValue.format(parameter, \\

 

            FME_MacroValues[parameter]), fmeobjects.FME_INFORM)

 

    else:

 

        logger.logMessageString(

 

            notDefined.format(parameter), fmeobjects.FME_WARN)