Last active
June 2, 2016 07:56
-
-
Save alanhay/164f8956d5a7cf0d68b969d49758df2b to your computer and use it in GitHub Desktop.
log4jdbc 2 Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dependency: | |
| <dependency> | |
| <groupId>org.bgee.log4jdbc-log4j2</groupId> | |
| <artifactId>log4jdbc-log4j2-jdbc3</artifactId> | |
| <version>1.15</version> | |
| <!-- <scope>test</scope> --> | |
| </dependency> | |
| Create a file named log4jdbc.log4j2.properties in src/x/resources with the folloiwng content: | |
| log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator | |
| Create the log4j.xml configuration file with the content below: | |
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
| <log4j:configuration debug="true" | |
| xmlns:log4j='http://jakarta.apache.org/log4j/'> | |
| <appender name="console" class="org.apache.log4j.ConsoleAppender"> | |
| <layout class="org.apache.log4j.PatternLayout"> | |
| <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" /> | |
| </layout> | |
| </appender> | |
| <root> | |
| <level value="DEBUG" /> | |
| <appender-ref ref="console" /> | |
| </root> | |
| <logger name="org.springframework"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="org.hibernate"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="org.dbunit"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="jdbc.audit"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="jdbc.connection"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="jdbc.sqltiming"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="jdbc.audit"> | |
| <level value="ERROR" /> | |
| </logger> | |
| <logger name="jdbc.resultset"> | |
| <level value="ERROR" /> | |
| </logger> | |
| </log4j:configuration> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment