The Salesforce driver provides a flexible and comprehensive logging mechanism of its Java components that allows logging to be incorporated seamlessly with the logging of your application or enabled and configured independently from the application. The logging mechanism can be instrumental in investigating and diagnosing issues. It also provides valuable insight into the type and number of operations requested by the application from the driver and requested by the driver from the remote data source. This information can help you tune and optimize your application.
The Salesforce driver uses the Java Logging API to configure and control the loggers (individual logging components) used by the driver. The Java Logging API is built into the JVM.
The Java Logging API allows applications or components to define one or more named loggers. Messages written to the loggers can be given different levels of importance. For example, errors that occur in the driver can be written to a logger at the ERROR level, while progress or flow information can be written to a logger at the INFO or FINER level. Each logger used by the driver can be configured independently. The configuration for a logger includes what level of log messages are written, the location to which they are written, and the format of the log message.
Setting the log threshold of a logger to a particular level causes the logger to write log messages of that level and higher to the log. For example, if the threshold is set to
FINE, the logger writes messages of levels FINE. CONFIG, and SEVERE to its log. Messages of level FINER or FINEST are not written to the log.
FINER - The message type and arguments for requests and responses sent between the driver and SQL Engine are logged at this level. Data transferred between the driver and SQL Engine is not logged.
Logs the operations that the SQL engine performs while executing a query. Operations include preparing a statement to be executed, executing the statement, and fetching the data, if needed. These are internal operations that do not necessarily directly correlate with Web service calls made to the remote data source.
CONFIG - Any errors or warnings detected by the SQL engine are written at this level.
FINE - In addition to the same information logged by the CONFIG level, SQL engine operations are logged at this level. In particular, the SQL statement that is being executed is written at this level.
FINER - In addition to the same information logged by the CONFIG and FINE levels, data sent or received in the process of performing an operation is written at this level.
CONFIG - Any errors or warnings detected by the Web service adapter are written at this level.
FINE - In addition to the information logged by the CONFIG level, information about Web service calls made by the Web service adapter and responses received by the Web service adapter are written at this level. In particular, the Web service calls made to execute the query and the calls to fetch or send the data are logged. The log entries for the calls to execute the query include the Salesforce-specific query being executed. The actual data sent or fetched is not written at this level.
FINER - In addition to the information logged by the CONFIG and FINE levels, this level provides additional information.
FINEST - In addition to the information logged by the CONFIG, FINE, and FINER levels, data associated with the Web service calls made by the Web service adapter is written.
If you want to configure logging using the properties file that is shipped with your JVM, use a text editor to modify the properties file in your JVM. Typically, this file is named logging.properties and is located in the JRE/lib subdirectory of your JVM. The JRE looks for this file when it is loading.
where properties_file is the name of the properties file you want to load.
NOTE: By default, the name of the embedded database is the user ID specified for the connection. You can specify the name of the embedded database using the DatabaseName property. Refer to
“Connection Option Descriptions” in
Chapter 21 of the
DataDirect Connect Series for ODBC User’s Guide for details on using LogConfigFile and other connection options.
By default, the driver looks for the file named ddlogging.properties in the current working directory to load for all Salesforce connections. If the SQLEngineMode connection option is set to Server, the driver uses the ddlogging.properties file that is specified by the Server DB Directory connection option.
2
|
If the driver cannot find the file in Step 1, it looks for a properties file named database_name.logging.properties in the directory containing the embedded database for the connection, where database_name is the name of the embedded database.
|
If any of these files exist, but the logging initialization fails for some reason while using that file, the driver writes a warning to the standard output (System.out), specifying the name of the properties file being used.
A sample properties filenamed ddlogging.properties is installed in the install_dir\
samples subdirectory of your product installation directory, where
install_dir is your product installation directory. For example, you can find the ddlogging.properties file in
install_dir\Samples\Bulkstrm,
install_dir\Samples\Bulk, and
install_dir\Samples\Example. You can copy this file to the current working directory of your application or embedded database directory, and modify it using a text editor for your needs.