EDB JDBC Connector logging v42.7.3.2

The EDB Postgres Advanced Server JDBC Connector supports the use of logging to help resolve issues with the JDBC Connector when used in your application. The JDBC Connector uses the logging APIs of java.util.logging that was part of Java since JDK 1.4. For information on java.util.logging, see The PostgreSQL JDBC Driver.

Note

Previous versions of the EDB Postgres Advanced Server JDBC Connector used a custom mechanism to enable logging. It's now replaced by the use of java.util.logging in versions moving forward from community version 42.1.4.1. The older mechanism is no longer available.

Previous versions of the Advanced Server JDBC Connector can enable logging using the connection properties, however it is no longer available from 42.3.3 onwards.

Enabling logging with logging.properties

The default Java logging framework stores its configuration in a file called logging.properties. You can use logging properties to configure the driver dynamically (for example, when using the JDBC Connector with an application server such as Tomcat, JBoss, WildFly, etc.), which makes it easier to enable/disable logging at runtime. The following example demonstrates configuring logging dynamically:

handlers = java.util.logging.FileHandler
//logging level
.level = OFF

The default file output is in the user’s home directory:

java.util.logging.FileHandler.pattern = %h/EDB-JDBC%u.log
java.util.logging.FileHandler.limit = 5000000
java.util.logging.FileHandler.count = 20
java.util.logging.FileHandler.formatter = 
java.util.logging.SimpleFormatter 
java.util.logging.FileHandler.level = FINEST  
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n

Use the following command to set the logging level for the JDBC Connector to FINEST (maps to loggerLevel):

com.edb.level=FINEST

Then, execute the application with the logging configuration:

java –jar -Djava.util.logging.config.file=logging.properties run.jar