title: How to log failed sql in hibernate?
body: <p>I'm building a SpringBoot application with spring-data-jpa. I know how to log all sqls from this question. <a href="https://stackoverflow.com/questions/1710476/how-to-print-a-query-string-with-parameter-values-when-using-hibernate">How to print a query string with parameter values when using Hibernate</a></p>
  
  <p>But what if I only want to log failed sqls?</p>