Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hibernate logback sql

I want to see the actual parameters of my SQL queries when I use Hibernate. I add this to my logback.xml to see the queries (with question marks):

<logger name="org.hibernate.type" level="TRACE" />

but to no effect.

Is there any special configuration necessary?

OnConsoleStatusListener shows me the correct configuration

23:48:15,246 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.hibernate.type] to TRACE

but no output from org.hibernate.type package.

I'm using Spring with Jpa.

like image 802
lincetto Avatar asked Nov 04 '12 23:11

lincetto


2 Answers

Things you have to make sure:

  1. Are you sure that SLF4J + LogBack is working in your app?
  2. Is your logger pointing to any appender?
like image 139
Adrian Shum Avatar answered Sep 18 '22 13:09

Adrian Shum


Have you configured an appended?

<configuration>
  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <!-- "application-name" is a variable -->
    <File>c:/logs/${application-name}.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%d %p %t %c - %m%n</Pattern>
    </layout>
  </appender>
  <root level="debug">
    <appender-ref ref="FILE"/>
  </root>
</configuration>
like image 45
Tinman Avatar answered Sep 18 '22 13:09

Tinman