Logging provides visibility into Parasoft JDBC Driver operations (for example, events and exceptions). This visibility is helpful when you start your initial database virtualization efforts because it facilitates analysis of configuration problems. It is also helpful when you are trying to diagnose the cause of unexpected behavior.
To configure remote logging for a Parasoft JDBC Driver:
- Ensure that your application and its corresponding JDBC/Data Source configuration is setup to use the Parasoft JDBC Driver. See About the Parasoft JDBC Driver for links to the available configuration topics.
- Open the associated JDBC Controller (from either the Virtualize Server view or the related Environment Manager instance) and do the following:
- Set the Log Level to 1 or greater.
- Set the Log Destination Type to the desired destination.
- If Log Destination Type is set to file, and Log Level is set to 1, use Log File to specify the desired path to that file.
Log Level
The log level settings specify the logging detail level (verbosity) for the Parasoft JDBC Driver. The logs are routed to the destination provided in the Log Destination Type setting.
Available options are:
Level | Description |
---|---|
0 | OFF. No logging takes place to any destination. |
1 | Log errors only. Stack traces are included in such errors. |
2 | Log errors and informational events to help debug and analyze issues. |
3 | Include stack traces with each logging entry. |
4 | Include traffic communicated between the Parasoft JDBC Driver and the Virtualize Server, but with no stack traces. |
5 | Includes 3 and 4 data. |
Use logging levels 3 and 5 with caution under limited circumstances and scenario runs only. Including stack traces for each informational log entry tends to grow the log file content very rapidly.
Log Destination Type
The Log Destination Type setting indicates where driver logging data should be saved or sent. This pertains to internal driver logging information, not where the database data is recorded. Once this option is set, future driver logging data will be routed to the specified destination.
Available options are:
Destination | Description |
---|---|
File | Saves into the specified log file location (on the machine where the Parasoft JDBC Driver is installed). |
Server | Submits the logging data to a remote Parasoft Virtualize Server so it can be viewed and analyzed there. This is convenient so that configuration debugging can be performed without having to access local log files on the application server where the Parasoft JDBC Driver is installed. The logging events are buffered, then transmitted in bursts every 5 seconds. See Additional Setup for Server Logging for details. |
stdout | Routes Parasoft JDBC Driver logging events to the standard console output. |
stderr | Routes Parasoft JDBC Driver logging events to the standard console error output. |
Additional Setup for Server Logging
The server logging options indicates that logging data should be sent to a remote Virtualize Server that is not necessarily running on the same host where the Parasoft JDBC Driver is. This helps with analyzing configuration problems and resolving issues without needing to directly access the file system of the host of the Parasoft JDBC Driver. It is also helpful for cases when security permissions do not allow the Parasoft JDBC Driver to write to the local file system.
For server logging, you also need to perform the following configuration on the Virtualize Server:
- Deploy the ServerLogger.pva file into the VirtualAssets project. You can do this by switching to the Navigator view in Virtualize and dragging that .pva file from your systems file explorer to the VirtualAssets project in Virtualize.
- The ServerLogger.pva is a specially configured virtual asset for receiving the Parasoft JDBC Driver log entries and saving them into a file. It can be found in the
<VIRTUALIZE-INSTALL-DIR>/proxies/
directory.
- The ServerLogger.pva is a specially configured virtual asset for receiving the Parasoft JDBC Driver log entries and saving them into a file. It can be found in the
- Modify the HTTP path of the deployed asset to
/ServerLogger
(which should make the HTTP endpoint something likehttp://hostname:9080/ServerLogger
). - (Optional) Open the .pva file (using the Virtual Asset Explorer view) and modify the local log file destination if desired. The pva is configured to save the logs to jdbc_proxy_driver_log.txt in
recorded_database_data/
, which is a convenient location adjacent to the database recorded data files when working on recording activities.
Once this setup is applied, the Parasoft JDBC Driver will send its logging (at the specified verbosity and detail) to Virtualize Server, which will use ServerLogger.pva to save the data to a file.
Log File
The Log File setting is applicable when Log Destination Type is set to file, and Log Level is set to 1 or higher. In these cases, the Log File setting specifies the full path to a text file where Parasoft JDBC Driver logging should be saved.
This property refers to the location of the local log file that is produced for debugging purposes (for example, events and exceptions coming from the actual JDBC driver). This is NOT the location of the file that logs recorded data. That file is always stored in the Virtual Assets project.