Difference between revisions of "Logging JDBC Activity"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Quick start)
(Quick start)
Line 9: Line 9:
 
   setLogLevel( "org.openoffice.sdbc.jdbcBridge", com.sun.star.logging.LogLevel.SEVERE )
 
   setLogLevel( "org.openoffice.sdbc.jdbcBridge", com.sun.star.logging.LogLevel.SEVERE )
 
</code>
 
</code>
 +
(See the [http://wiki.services.openoffice.org/wiki/Category:Logging overview] for how to tweak more parameters of the logger.)
 
* (maybe restart OpenOffice.org)
 
* (maybe restart OpenOffice.org)
 
* do whatever needs to be logged
 
* do whatever needs to be logged
 
* look into the log file, which is <code>$(userurl)/org.openoffice.sdbc.jdbcBridge.log</code>
 
* look into the log file, which is <code>$(userurl)/org.openoffice.sdbc.jdbcBridge.log</code>
 
See the [http://wiki.services.openoffice.org/wiki/Category:Logging overview] for how to tweak more parameters of the logger.
 
  
 
== Logged Events ==
 
== Logged Events ==

Revision as of 08:57, 23 May 2007

Base's JDBC bridge - the database driver to access database with an JDBC compliant driver - allows to log its activity. For this, the driver uses a logger named "org.openoffice.sdbc.jdbcBridge".

Quick start

Say you want to see erros which happen in an JDBC driver. With the Basic macros found in the overview article, this boils down to

  • execute

[starbasic]

 setLogLevel( "org.openoffice.sdbc.jdbcBridge", com.sun.star.logging.LogLevel.SEVERE )

(See the overview for how to tweak more parameters of the logger.)

  • (maybe restart OpenOffice.org)
  • do whatever needs to be logged
  • look into the log file, which is $(userurl)/org.openoffice.sdbc.jdbcBridge.log

Logged Events

Below are lists of which events are logged at which log level. Note that if you enable logging for a certain level, then all events of this level and above are logged. Below, the levels are in decreasing order.

LogLevel.SEVERE

  • a driver class which has not been set up correctly
  • a failure in obtaining the JDBC connection which is to be bridged
  • most (if not all) exceptions thrown by the JDBC driver

LogLevel.WARNING

No events are logged at this level.

LogLevel.INFO

LogLevel.CONFIG

No events are logged at this level.

LogLevel.FINE

  • statement related connection activity, such as creation and preparation of statements and calls
  • successful retrieving of a system JDBC connection

LogLevel.FINER

  • setting certain statement attributes such as fetch direction and fetch size
  • setting parameters of a prepared statement
  • translating SQL statements to native SQL
  • the update count of statements

LogLevel.FINEST

  • meta data activitiy, such as asking for database properties and settings
Personal tools