JDBC logging to file

前端 未结 6 566
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 02:43

I need to log all the queries to an Oracle database in my project to a log file.

What would be a good solution to achieve this? Some sample usage would be a

6条回答
  •  爱一瞬间的悲伤
    2020-12-06 02:45

    As an update to the answer of @Martin_Schröder, it also now exists log4jdbc-log4j2, which allows to use either slf4j or Log4j2, is available on the Maven repository, and supports JDBC 4.1 (Java 7).

提交回复
热议问题