LOG        Control the script log file

Top  Previous  Next

Syntax:

LOG

[ file name ]  |  [ /options ]

Arguments:

[ file name ]

Optional variable or string defining a file or path name; if no path is defined Robo-FTPs working folder is used.

Options:

/all

Write all logging messages, overrides the “@” and “!” logging suppression prefixes.

 

/append

Specify that log data is to be appended to preexisting [ file name ] (if any); if the file does not exist, it will be created.

 

/maxsize=xx

Specify the maximum size of the log file (in Kilobytes).

 

/new

Specify that a new log file name is to be created (based on the current date and time) when this command is executed and whenever an existing log file reaches the maximum size (if a size has been specified).

 

/off

Turn script file logging off.

 

/on

Turn script file logging on (assuming that [ file name ] has been previously defined on an earlier call to LOG or a log file has been previously defined under the Logging menu of the Robo-FTP Configurator).

 

 

The Script Log file records all commands and status messages that occur during a file transfer session. This file is useful to determine if an unattended session was successful. You must attach copies of the Script Log and Trace Log showing the problem when you submit a support request asking for help troubleshooting a script or command.

 

If the [ file name ] argument is present, this script command creates a new script log file by this name. It is also implied that script logging is to be turned on.

 

The /new option instructs Robo-FTP to create a new log file name using the current date and time. Such a file will be created when the command is executed and, if the /maxsize option is also specified, whenever the log file exceeds this maximum size. The [ file name ] argument must be present, but it can be an empty string. Robo-FTP takes the base file name (i.e., the part of the file name before any extension) and appends the current date and time in the fashion shown below. Notice that if no extension is originally specified, Robo-FTP appends .log to the final file name.

 

LOG "mylog" /new  

// creates log file = mylog Wed Oct 30 15.38.43 2002.log

 

LOG "mylog.txt" /new  

// creates log file = mylog Wed Oct 30 15.38.43 2002.txt

 

LOG "mylog.xx.log" /new  

// creates log file = mylog Wed Oct 30 15.38.43 2002.xx.log

 

LOG "" /new  

// creates log file = Wed Oct 30 15.38.43 2002.log

 

When the /new option is used the name of any newly created log file is available in the %currentlogfile script variable.

 

The /maxsize option limits the maximum size that a log file can grow to. The size is specified in kilobytes. When the maximum size is reached, Robo-FTP handles this condition in one of two ways. If /new is also specified, the current log file is simply closed and a new file is created using the convention described above. If /new is not present, Robo-FTP toggles between two files. When the first file is full, it is closed and a second created and written to. When the second file is full, it is closed and the first file is reopened, cleared, and logging continues. This alternating between files continues until Robo-FTP terminates. When /maxsize is present, [ file name ] is altered as shown below. Notice that if no extension is originally specified, Robo-FTP appends .log to the final file name.

 

LOG "mylog" /maxsize=100  

// creates log file = mylog 1.log

// this alternates with a file to be named mylog 2.log

 

LOG "mylog.txt" /maxsize=100

// creates log file = mylog_1.txt

// this alternates with a file to be named mylog 2.txt

 

The /append option instructs Robo-FTP to append new log data to a previously existing file specified by [ file name ]. If [ file name ] does not exist, it will created. The /append option may be combined with /maxsize but may not be used with the /new option.

 

In the following example the %date internal variable is used together with the /append option in a manner than ensures all activity for each day  is recorded in a single log file.

 

SET LogName = %date + ".log"

LOG LogName /append

// creates one log per day named MM-DD-YY.log

 

If [ file name ] is omitted, the /on and /off options control logging to a previously defined log file. When logging is turned on, new log messages are appended to the existing log file. For example:

 

LOG /off

 

Related Command(s): LOGMSG, SESSIONLOG, TRACELOG, WORKINGDIR

See also: Suppressing Log Output, %currentlogfile, Basic Logging, Advanced Logging