Quantcast
Channel: Magnus K Karlsson
Viewing all articles
Browse latest Browse all 526

How to Log SQL Statements, Parameters and Cache in Hibernate?

$
0
0

Introduction

Current implementation of Hibernate are:

  • Hibernate 4.2 implements JPA 2.0 (EE 6)
  • Hibernate 4.3+ implements JPA 2.1 (EE 7)

Logging

Do not set logging level in persistence.xml (hibernate.show_sql, hibernate.format_sql), instead use Log4J for changing logging level.

You can put this in you src/test/resources/log4j.properties if you want more logging when writing or debugging your test cases.

Reference


Viewing all articles
Browse latest Browse all 526

Trending Articles