|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
|---|---|
| CallbackLogParams | CallbackLogParams is data object and contains parameters from callback that are interesting for logging. |
| LoggingCallback | LoggingCallback implements JDBC logging logic. |
| LoggingCallback.CsvFormatter | CsvFormatter formats log messages to comma separated value form. |
| LoggingCallback.HumanFormatter | HumanFormatter formats log messages to human readable form. |
| SimonFormatter | SimonFormatter is abstract root for custom log formatters for logging feature of Simon JDBC driver. |
Logging feature of Simon JDBC Proxy driver.
This logging feature is based on Callback feature of Javasimon core library, see Callback.
In short, Callback feature allow intercept event from Simon (like start, stop, etc.) and perform custom action,
in this case log message with details into file or to console.
By default, start and stop event from all JDBC stopwatch Simons are logged. Jdbc stopwatches are determined by provided JDBC prefix. This means that logged events are connections starts and stops, statements starts and stops and sql executions.
Java standard logging feature (java.util.logging) is used for logging from Simon JDBC Proxy driver. There
are three targets where to log and also three ways how to setup logging.
Where to log:
ConsoleHandler so messages
are printed to error output (or somewhere where an output is redirected)
Logger
FileHandler
SimonFormatter.
Driver.
<simon-configuration> <callback class="org.javasimon.jdbc.logging.LoggingCallback"> <!-- don't mix it with org.javasimon.utils.LoggingCallback! --> <set property="prefix" value="org.javasimon.testdb"/> <set property="loggerName" value="myapp.testdb"/> <set property="logFilename" value="log/myapp.log"/> <set property="logToConsole"/> <!-- without value! --> <set property="logFormat" value="csv"/> <!-- can be also human --> </callback> ... </simon-configuration>If
logToConsole or logFilename is omitted respective handler will not be used.jmx.JdbcMXBean that provides methods for starting logging
to file, logger or console and for stopping too. Each method has its parameters to setup specific details.
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||