SET_LOG_FILE
The SET_LOG_FILE command sets the name of the file to log status, warning, and error messages to. If the log file specified already exists, the messages will be appended to the end of it. The following parameters are supported by the command.
-
FILENAME - full path to log file to write messages to
-
USER_FILENAME - full path to log file to write messages from the LOG_MESSAGE command. Use this if you want your own messages to go to a different file than any automatically generated script messages. Pass in with an empty value to reset the LOG_MESSAGE messages to go back to the shared file.
-
APPEND_TO_FILE - This option controls whether to append log messages to an existing file or start a new log file.
By default, log messages will be appended to an existing log file. Use APPEND_TO_FILE=NO to delete the existing log file and start a new one. The log file will be deleted when this command is processed, so it is a good idea to have the SET_LOG_FILE command at the beginning of a script.
EXAMPLE
SET_LOG_FILE FILENAME="C:\Temp\script_log.txt" APPEND_TO_FILE=NO
In this example, if the file C:\Temp\script_log.txt exists, it will be deleted and a new log file with that name will be created.