Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I configure java.util.logging to get useful trace output from Oracle JDBC?

0
10 Posted

How do I configure java.util.logging to get useful trace output from Oracle JDBC?

0

The JDBC code creates a number of Loggers. In order to get interesting output you need to set the logLevel on each of these Loggers and add a PrintHandler somewhere. See the JavaDoc for java.util.logging for more information. Or, you can use the convenient property file OracleLog.properties provided in the demo.zip file that is part of the Oracle JDBC drivers installation. The comments in this file explain how to use it. This is much easier and highly recommended. Note that in either case you still have to enable logging to get trace output. You can toggle trace output on and off without reconfiguring the Loggers. The Diagnosibility MBean doesn’t mess with the Loggers at all. If you don’t want to change your source to call the MBean you can add -Doracle.jdbc.Trace=true to your java execution command. This will log the entire execution. For more info on configuring JDBC logging see the white paper on JDBC logging. A couple of hints: setting the Level to INFO will log the SQL that is exe

0

The JDBC code creates a number of Loggers. In order to get interesting output you need to set the logLevel on each of these Loggers and add a PrintHandler somewhere. See the JavaDoc for java.util.logging for more information.Or, you can use the convenient property file OracleLog.properties provided in the demo.zip file that is part of the Oracle JDBC drivers installation. The comments in this file explain how to use it. This is much easier and highly recommended.Note that in either case you still have to call oracle.jdbc.driver.OracleLog.setTrace(true) to get any JDBC trace output. You can toggle trace output on and off without reconfiguring the Loggers. setTrace doesn’t mess with the Loggers at all. If you don’t want to change your source to call OracleLog.setTrace you can add -Doracle.jdbc.Trace=true to your java execution command. This will log the entire execution.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123