I am working on spring (5.1.9. Release) JDBC project with log4j dependency and deployed the web application on Tomcat 8.5.
Below is a snippet of pom.xml
file for my project:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
Also, this is the log4j.properties
file available in resource folder in my project:
# Root logger option
log4j.rootLogger=stdout,DEBUG
# Redirect log messages to console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm} %-5p %c{1}:%L - %m%n
log4j.appender.stdout.Threshold=DEBUG
log4j.category.org.springframework=TRACE
I just want to print the debug logs for my Spring JDBC but it seems to be not working.
I have gone through several solutions but it is not showing the debug logs of spring JDBC on console.
What am I missing in the above configuration?