Syntax:

LOGTO(file,APPEND)

  • file: name of the log file. A path may also be included.
  • APPEND (optional): append the script messages to the file instead of overwriting it.

Return value:

This command will return “OK” or else an error code if something went wrong opening the log file.

Remarks:

If the file exists it will be overwritten, use the APPEND parameter to change this behaviour.

See also:

STOPLOG
Logging ScriptFTP messages

Examples:

LOGTO("C:\logs\TransferLog.txt",APPEND)
OPENHOST("ftp.host.com","myuser","mypassword")
PUTFILE("C:\PICS\*.jpg")
CLOSEHOST
 
# Get the current date
$date=GETDATE()
 
# Concatenate "BACKUP", the current date and ".txt" to build the log file name
$logfile="C:\BACKUP_LOGS\BACKUP-".$date.".txt"
 
# Start logging
LOGTO($logfile)
 
OPENHOST("ftp.host.com","myuser","mypassword")
PUTFILE("C:\PICS\*.jpg")
CLOSEHOST