How to log into the log file, not only on the Workbench log window, the workspace parameters used to start it?
Page 1 / 1
Kathy is correct. In FME 2012 you will usually find it on line 7 (or thereabouts) in the log file.
David
The TCLCaller can be used to write non-published params.
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
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.
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?
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 = p"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_MacroValuesrparameter]), fmeobjects.FME_INFORM)
else:
logger.logMessageString(
notDefined.format(parameter), fmeobjects.FME_WARN)