title: How can I log SQL statements in Spring Boot?
body: <p>I want to log SQL statements to a file.</p>
  <p>I have the following properties in <code>application.properties</code>:</p>
  <pre class="lang-none prettyprint-override"><code>spring.datasource.url=...
  spring.datasource.username=user
  spring.datasource.password=1234
  spring.datasource.driver-class-name=net.sourceforge.jtds.jdbc.Driver
  
  spring.jpa.show-sql=true
  spring.jpa.properties.hibernate.format_sql=true
  
  security.ignored=true
  security.basic.enabled=false
  
  logging.level.org.springframework.web=INFO
  logging.level.org.hibernate=INFO
  logging.file=c:/temp/my-log/app.log
  </code></pre>
  <p>When I run my application,</p>
  <pre class="lang-none prettyprint-override"><code>cmd&gt; mvn spring-boot:run
  </code></pre>
  <p>I can see SQL statements in the console, but they don't appear in <em>app.log</em>. The file contains only basic logs from Spring.</p>
  <p>What should I do to see SQL statements in the log file?</p>