Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems with hibernate logs

 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

We have just moved our development to jboss 4.2.2. Everything works fine except that we are getting lots of logs from hibernate like:


01:44:20,976 INFO [STDOUT] Hibernate:
select
cataloguee0_.id as id24_,
cataloguee0_.name as name24_,
cataloguee0_.paren


I was trying to get rid of them by configuring log4j, looking in documentation and everywhere but I failed to find information how to hide those informations. I would be grateful for any advice.

Kind Regards,
k.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you will have to do a couple of changes:

1) Set show_sql = false. You can do this in the hibernate.properties (or hibernate.cfg.xml)

2) In the log4j.xml (rather jboss-log4j.xml) add the following:

 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Jaikiran,

Thank you for your fast answer. Unfortunatelly your solution didn't help. Where should I put the hibernate.properties or hibernate.cfg.xml files ? I tried to put them into lib dirs, WEB-INF/classes but it didn't help at all (I have impression that hibernate doesn't read those files).

Kind Regards,

k.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Going by your first post, i assumed that you already have a hibernate.properties(or hibernate.cfg.xml) in your application. Isn't that the case? The Hibernate logs that you posted, are they from your application?
 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks a lot for your help. I solved the issue. What I had to do is to set the show_sql property in persistence.xml file of my project.

Regards,

k.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great

It didn't occur to me that you might be using JPA and not hibernate directly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic