Journal
Adapter mode
Mybatis own set of unified logging and for the upper use, use the adapter mode provides adapters for common logging framework
LogFactory
Logging component is responsible for creating the corresponding adapter, the static initialization block will be loaded in order to load each log adapter components, and use the first load of logs to component adapter to save logConstructor
this static field
JDBC debug log
BaseJdbcLogger
Bind SQL parameters related to the recording of the set, and a method name associated with the implementation of the SQL statement
ConnectionLogger
encapsulates Connection
an object while achieving InvocationHandler
the object, its newInstance()
method will encapsulate its Connection
object is to create a proxy object. Which invoke()
method prepareStatement(),prepaerCall(),createStatement()
provides agents and other methods, in particular creates a corresponding Statement object and proxy object to call these methods and return the proxy.
PreparedStatementLogger,StatementLogger,ResultSetLogger
The newInstance()
methods are similar, their invoke()
method will add a log to print their corresponding methods of function