0

I have the below log4j.xml in placed in the src directory of a web application. Even after follwing many post examples, i cannot get the below configuration print jdbcTemplate internals to log file.

Config:

<appender name="INTERNALSLOG" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="C:/springDB.log"/>
    <param name="Append" value="true"/>
    <param name="MaxFileSize" value="10mb"/>
    <param name="MaxBackupIndex" value="5"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%t] %C{2} - %m%n"/>
    </layout>
  </appender>

 <logger name="org.springframework.jdbc.core">
    <level value="DEBUG" />
    <appender-ref ref="INTERNALSLOG"/>
  </logger>

Whats wrong with the configuration. Just want to get the sql's from jdbcTemplate printed.

Vishnu
  • 1,011
  • 14
  • 31
  • 1
    Look at http://stackoverflow.com/questions/1792244/spring-jdbc-is-not-logging-sql-with-log4j – ema May 11 '15 at 12:26
  • Yes, i have reffered it the answere say it work but not for me. I am using spring 3.2.9 and log4j 1.2.9 – Vishnu May 11 '15 at 13:00

0 Answers0