TRACELOG Control the trace log file
<< Click to Display Table of Contents >> Navigation: Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands > TRACELOG Control the trace log file |
Syntax: |
TRACELOG |
[ file name ] | [ /options ] |
Arguments: |
[ file name ] |
Optional variable or string defining a file or path name; if no path is defined the default path is used. |
Options: |
/append |
Specify that trace data is to be appended to preexisting [ file name ] (if any); if the file does not exist, it will be created. This option does not work with the /new option. |
|
/backups=x |
This option is used together with the /maxsize option to specify the number of backup files to cycle through. If /maxsize is used without this option only one backup is used. |
|
/debug |
Enables extended debugging messages. |
|
/maxsize=xx |
Specify the maximum size of the trace log file (in Kilobytes). |
|
/new |
Specify that a new trace log file name is to be created (based on the current date and time) when this command is executed and whenever an existing trace log file reaches the maximum size (if a size has been specified). |
|
/off |
Turn trace logging off. |
|
/on |
Turn trace logging on (assuming that [ file name ] has been previously defined on an earlier call to TRACELOG or a log file has been previously defined under the Logging menu of the Robo-FTP Configurator). |
If the [ file name ] argument is present, this script command creates a new trace log file by this name. It is also implied that logging is to be turned on. The trace log file records trace and diagnostic messages that may be helpful in troubleshooting file transfer failures.
The /new option instructs Robo-FTP to create a new trace 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 trace 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 first (i.e., the part of the file name before any extension) then appends the current date and time and then adds the extension at the end. If no extension is originally specified, Robo-FTP appends .log to the final file name.
TRACELOG "trace.txt" /new
;; creates trace log file = trace Sat Oct 30 15.38.43 2010.txt
TRACELOG "trace" /new
;; creates trace log file = trace Sat Oct 30 15.38.43 2010.log
TRACELOG "trace.xx.log" /new
;; creates trace log file = trace Sat Oct 30 15.38.43 2010.xx.log
TRACELOG "" /new
;; creates trace log file = Sat Oct 30 15.38.43 2010.log
When the /new option is used the name of any newly created log file is available in the %currenttracelogfile script variable.
The /maxsize option limits the maximum size that a trace log file can grow. 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 trace log file is simply closed and a new file is created using the convention described above. If /new is not present, Robo-FTP renames the current log file to <filename>.1 so it can be saved as a backup and then creates a new log file using the original file name. Every subsequent time that the trace log file is filled to /maxsize kilobytes it is renamed <filename>.<number> with the number portion of the log file's name incrementing sequentially until it reaches the value specified in the /backups option at which point it cycles back to 1. If the /backups option is omitted only one backup file will be created. This behavior is explained in the comments of the following examples:
TRACELOG "trace.txt" /maxsize=100
;; when the log file trace.txt reaches 100 KB:
;; rename it trace.txt.1 and then create a new trace.txt file
;; when the second trace.txt file reaches 100 KB,
;; rename trace.txt to trace.txt.1 (overwriting the existing trace.txt.1 file)
;; then create a new trace.txt file
TRACELOG "trace.txt" /maxsize=100 /backups=3
;; when the log file trace.txt reaches 100 KB:
;; rename it trace.txt.1 and then create a new trace.txt file
;; when the second trace.txt file reaches 100 KB,
;; rename it trace.txt.2 and then create a new trace.txt file
;; when the third trace.txt file reaches 100 KB,
;; rename it trace.txt.3 and then create a new trace.txt file
;; when the fourth trace.txt file reaches 100 KB,
;; rename trace.txt to trace.txt.1 (overwriting the existing trace.txt.1 file)
;; then create a new trace.txt file
The /append option instructs Robo-FTP to append new trace data to a previously existing file specified by [ file name ]. If [ file name ] does not exist, it will be created. The /append option may not be combined with the /new option.
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:
TRACELOG /off
Related command(s): LOG, SESSIONLOG, TRACEWIN
See also: Trace Window, %currenttracelogfile, Interactive Debugging, Basic Logging, Advanced Logging, Troubleshooting, Default Path