Debugging

The ExtraView Log File

The ExtraView application server log is a very valuable tool in writing and debugging Java in ExtraView. It is possible to issue timestamped messages to the log file while the program is running. The following sample call is used to issue log messages:

Z.log.writeToLog (Log.DEBUG, "String to be inserted");

This will insert the parameter string into the log subject to the log filtering constraints. In general, the "log level" is set internally to a value that allows only error, critical error, and information messages to be inserted to the log. However, a simple CLI command can set the debug level for log messages:

debug 7

You can also set the log level with a URL, such as:

http://www.mycompany.com/evj/ExtraView?DEBUG=7

This sets the log level internally to allow all DEBUG messages to be stored in the log, viz., those that are issued by the program with “Log.DEBUG” as the first parameter.

Where is the log file? It is located in:

<tomcat-base>/webapps/<instance-name>/WEB-INF/logs/<logname>.log

However, there is a parameter named LOG_FILE_PATH_NAME within the Configuration.properties file that allows you to relocate the log file to a different location. The log file is a simple sequential text file that can be read using any text editor.

Debug Levels

Up to 12 levels of debugging are provided. Level 6 is the value used for production sites, and 6 means only messages with a level of 6 or less are written to the log.

Note: A value greater than 6 can significantly impact the performance of a production system, and should only be used when trying to trace a specific problem.

The following error levels are defined for the log –

DEBUG Name DEBUG Level
ALERT 1
CRITICAL 2
ERROR 3
WARN 4
NOTICE 5
INFO 6
DEBUG 7
DEBUG2 8
DEBUG3 9
DEBUG4 10
DEBUG5 12

Monitoring and Evaluating the SQL that is Executed

If you insert the line

PSP_LOG = YES

Into the WEB-INF/configuration/Configuration.properties file, then an entry is made into the log file, showing each SQL statement as it is executed, along with all the bind variables used in its execution.

Monitoring and Evaluating Ajax calls

If you insert the line

AJAX_LOG = YES

Into the WEB-INF/configuration/Configuration.properties file, then an entry is made into the log file, showing metrics about each Ajax call as it is executed.