spring log4j jdbc

jdbc.sqlonly : 仅记录 SQL

jdbc.sqltiming :记录 SQL 以及耗时信息

jdbc.audit :记录除了 ResultSet 之外的所有 JDBC 调用信息,会产生大量的记录,有利于调试跟踪具体的 JDBC 问题

jdbc.resultset :会产生更多的记录信息,因为记录了 ResultSet 的信息

jdbc.connection :记录连接打开、关闭等信息,有利于调试数据库连接相关问题

jdbc.sqlonly

Logs only SQL. SQL executed within a prepared statement is automatically
shown with it’s bind arguments replaced with the data bound at that position, for greatly
increased readability.

jdbc.sqltiming

Logs the SQL, post-execution, including timing statistics on how long the SQL
took to execute.

jdbc.audit

Logs ALL JDBC calls except for ResultSets. This is a very voluminous output, and
is not normally needed unless tracking down a specific JDBC problem.

jdbc.resultset

Even more voluminous, because all calls to ResultSet objects are logged.

jdbc.connection

Logs connection open and close events as well as dumping all open connection
numbers. This is very useful for hunting down connection leak problems.

参考文章

评论