Logging Jobs Started from Within a USoft Application
Log files can be started and maintained for batch jobs that are started from within an application, or from the rules service, using the ActionStartJob() and BatchRunner.RunJob() methods. You can specify that a log file is to be made, by using the -logfile parameter with the method concerned.
If a rules service is set to no logging, any jobs started from that rules service are also set to no logging.
If you want to specify a different file name for a log file, you can also do this using the -logfile parameter.
You can specify a full pathname, a file name, or a folder name. If you specify a folder name, the value must end with a backslash (\) character on Windows systems. On Unix systems, this would be a forward slash (/) character. If you only specify a folder, the filename will be <jobname>.date.log.
A log file name with an .xml suffix will result in a log file in XML format.
If you do not specify a file name or folder, the log file is created in the logging folder you specified during USoft setup.
If jobs are invoked from within other jobs,and they are invoked using the same log file name in their calls, the output of all these jobs is appended to the same file. If the names are different, and no path is specified, the log file is created in the same folder as the previous file that was created.
Note that the -quiet parameter has no effect if -logfile is used.
By default, if the log file specified already exists, the log information will be appended to the file. You can overwrite the existing log file by specifying the parameter:
action job(J1, -logfile =j1.log) or action job(J1, -logfile)
select batchrunner.runjob ('J1' jobname, 'j1.log' "-logfile", 'True' "-wlogfile")
invoke batchrunner.runjob with select 'J1' jobname, 'c:\temp\' "-logfile", 'True' "-wlogfile"
select batchrunner.runjob ('J1' jobname, 'True' "-logfile", 'True' "-wlogfile")