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
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).