title: Spring Boot JDBC Template SQL Log
body: <p>I am trying log SQL queries with params for Spring Boot JDBC but it is not printing  the details in log.I am using Spring Boot 1.5.8 version.Please help me to solve this.</p>
  
  <p><strong>application.properties:</strong></p>
  
  <pre><code>spring.datasource.url=url
  spring.datasource.username=user
  spring.datasource.password=password
  spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
  
  logging.level.org.springframework.jdbc.core.JdbcTemplate=debug
  
  spring.datasource.type = com.zaxxer.hikari.HikariDataSource
  spring.datasource.hikari.connection-timeout=60000
  spring.datasource.hikari.maximum-pool-size=2
  </code></pre>
  
  <p><strong>Repository:</strong></p>
  
  <pre><code>@Repository
  public class DataRepository {
      private static Logger log = LoggerFactory.getLogger(DataRepository.class);
  
      @Autowired
      private NamedParameterJdbcTemplate jdbcTemplate;
  
      public Data findDataObjet() throws Exception {
  
          Map&lt;String, Object&gt; parameters = new HashMap&lt;&gt;();
          parameters.put("id1", "mike");
          parameters.put("id2", new Long(1));
  
          String sqlString = "select * from table1 where id1 = ":id" and id2 = :id2";
          log.info("Query:" + sqlString);//this log is printing
  
          Data extObj = jdbcTemplate.query(sqlString, parameters, (rs) -&gt; {
              if (rs != null &amp;&amp; rs.next()) {
                  Data innerObj = new Data();
                  innerObj.setName(rs.getString("name"));             
                  return innerObj;
              } else {
                  log.info("No records found:"+rs);
                  return null;
              }
          });
  
          return extObj;
  
      }
  }
  </code></pre>
  
  <p><strong>logback-spring.xml:</strong></p>
  
  <p></p>
  
  <pre><code>&lt;appender name="dailyRollingFileAppender"
      class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
          &lt;FileNamePattern&gt;${logsPath}DATA%d{MMddyyyy}.log
          &lt;/FileNamePattern&gt;
          &lt;maxHistory&gt;4&lt;/maxHistory&gt;
      &lt;/rollingPolicy&gt;
  
      &lt;encoder&gt;
          &lt;Pattern&gt;%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level
              %logger{35}-%msg %n&lt;/Pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  &lt;root level="INFO"&gt;
      &lt;appender-ref ref="dailyRollingFileAppender" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p></p>