Home » hibernate » Double-logging in Hibernate

Double-logging in Hibernate

All I can think of:
  1. Check that your log4j config doesn’t have multiple appenders defined at different levels? If you have your appender attached to the org.hibernate logger, and attached again to the org.hibernate.SQL logger, then you’ll see this twice (unless you turn off additivity for the lower-level logger).
  2. You don’t have the hibernate.show_sql property set on your SessionFactory? That doesn’t enable logging to log4j (you do that through log4j config), it just dumps to the console. If your log4j is dumping to the console too you’ll see it twice. However, that looks like a log4j format log line, not the console dumps done by hibernate, so that seems unlikely. Worth mentioning though.

Leave a comment