Basic Logging

Top  Previous  Next

 

Logging Overview

Log files are by far the most important tools for troubleshooting issues encountered when executing command scripts. Robo-FTP can generate three types of log files that can help you debug a command script that did not execute as expected:

Script Log - lists all commands executed and status messages returned
Trace Log - records protocol trace and diagnostic messages helpful in troubleshooting many errors
Session Log - contains diagnostic messages regarding secure sessions (SSH/SSL)

 

 

Creating the Log Files Required for Troubleshooting

We recommend that you always enable the Script Log and Trace Log because they are crucial for troubleshooting all but the most trivial problems. The Session Log has a much more limited purpose and should only be enabled while actively troubleshooting a secure session problem. Carefully follow the five steps below to create the Script Log and Trace Log files.

 

 

Step 1) Enabling the Default Log Files

Use the Logging menu in the Configurator program to enable the default log files. In the image below, the default Script Log and Trace Log are enabled but the default Session Log is disabled. The default folder for these logs is the Robo-FTP installation folder but you can change the path by clicking the folder button to the right of the log file name.

 

Logging Tab

 

 

Step 2) Run your script

Execute the script (or series of commands) to create a fresh set of log files showing the problem that you want to troubleshoot. If are in a hurry but your script is configured to run on a schedule as a Windows Service or Scheduled Task you might consider launching it from the main console window instead of waiting for the next regularly scheduled execution.

 

 

Step 3) Open the log files.

Open the Script Log and Trace Log files in a text editor program. To use the RoboEDIT script editor to open both log files at once in separate tabs, launch RoboEDIT and click File -> Open on the top menu and then follow these steps:

A.Change the file type filter to All Files (*.*) in the lower right corner of the Open File form.
B.Sort the files descending by date so the newly created log files appear near the top of the list. If your computer is not configured to display the modified date you can sort on the file Name column and scroll down to find the files.
C.Select both log files by holding down the Ctrl key and clicking both file names.
D.Click the Open button (or hit the Enter key) to open both log files at once. Each file will be displayed in a separate tab.

 

robo_open_logs

 

 

Step 4) Verify the timestamps

Each row of the Script Log and Trace Log files begins with a timestamp. Compare the current time to the timestamps in both logs to verify that each file captured the most recent script execution from step 2 above. The screenshot below shows each log file opened in a separate tab in the RoboEDIT program. Notice that although the top row timestamps do not match, later rows make clear that both files were created during the same script execution.

 

robo_compare_logs

 

 

Step 5) Verify the Script Log shows the error

Examine the Script Log file and verify that it contains the script or commands that you want to troubleshoot. The screenshot below shows an example of a Script Log that does not contain useful troubleshooting information because the LOG command was used to redirect logging output to a different file. In this example, the troubleshooting information you really need is in the file named AcmeDownload_script.log instead  of the default Robo-FTP_Script.log file.

 

robo_junk_script_log

 

 

Finding missing log files

If you can't find your log files, search your command script for the LOG or TRACELOG commands because they can override the default settings that you configured on the Logging menu in the Configurator. If your script uses the LOG or TRACELOG commands to specify a file name without a complete path, the log files will be created in the working directory. The current local working directory may be changed by using the WORKINGDIR command or by using the FTPLOGON command to connect to a Managed Site with a value in the Initial Local Directory field.

 

The Robo-FTP installation folder is the default initial local working directory but this default can be changed by modifying the value of the "Working Directory" field on the Files menu in the Configurator. If Robo-FTP is executing in the security context of a Windows user that lacks sufficient permissions then the initial working folder reverts to the \Robo-FTP directory under the user's profile. This is mostly like to happen on computers with User Access Control (UAC) enabled or when your script is executed by a Windows Scheduled Task or Windows Service.

 

The easiest way to find missing log files may be to simply log in to Windows under the user account that is normally used to launch your script and then run it in Robo-FTP's main console window. After script processing is complete, scroll back up in the console window and examine each line looking for the full path of the log files, like this:

 

*Script log file ready - C:\Program Files (x86)\Robo-FTP\my_script_log.txt

 

Logging will fail if the account Robo-FTP is running under lacks sufficient Windows permissions to create and modify the log files. Remember to always verify that your log files are still being created after migrating your Robo-FTP installation to another computer or after setting up Robo-FTP up to be launched as a scheduled task or as a Windows service.

 

 

Related command(s): LOG, TRACELOG, SESSIONLOG

See also: Advanced Logging, Debug Logging, Troubleshooting, Interactive Debugging