- java.util.logging _ Can be configure from providing a simple issue track, such as running out resource, to something more specific and detail tracing on an internal execution of a system.
- javax.management _ Can consult and change system's behavior through MBeans, accumulate statistics and notify in states changes on error's behaviors.
- ojdbc5_g.jar
- ojdbc6_g.jar
*That's is why they have named these drivers with an *_g.jar at the end.
1- To enable the tracing you need to add at the java startup argument the following flag:
-Doracle.jdbc.Trace=true
This flags enable the global logging, if you want to debug the entire application this' the way to go.
2- Now we need to add the following flag on the java startup in which gives a path to an configuration file properties:
-Djava.util.logging.config.file=/jdbc/home/JDBCLogging.properties
3- Create the file /jdbc/home/JDBCLogging.properties; and set as following:
.level=SEVERE
oracle.jdbc.level=INFO
oracle.jdbc.handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
This will throw the output into the console, there fore no log file should be created. If you need to actually to produce a physical log you need to set as following:
.level=SEVERE
oracle.jdbc.level=INFO
oracle.jdbc.handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=INFO
java.util.logging.FileHandler.pattern=jdbc.log
java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
The amount of details are controlled by choosing bellow values, from less information to most detail information:
- OFF
- SEVERE
- WARNING
- INFO
- CONFIG
- FINE
- FINER
- FINEST
- ALL
- oracle.jdbc
- oracle.jdbc.driver
- oracle.jdbc.pool
- oracle.jdbc.rowset
- oracle.jdbc.xa
- oracle.sql
These flags can be simply add to the /jdbc/home/JDBCLogging.properties like:
.level=SEVERE
oracle.jdbc.level=INFO
oracle.jdbc.driver.level=ALL *
oracle.jdbc.handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=INFO
java.util.logging.FileHandler.pattern=jdbc.log
java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
ref:
- http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/toc.htm
- http://docs.oracle.com/javase/7/docs/api/index.html?javax/management/openmbean/package-summary.html
- http://docs.oracle.com/cd/B28359_01/java.111/b31224/toc.htm
No comments:
Post a Comment