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.

2
  • 1
    Look at stackoverflow.com/questions/1792244/… Commented May 11, 2015 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 Commented May 11, 2015 at 13:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.