aspose file tools*
The moose likes JBoss/WildFly and the fly likes problems with hibernate logs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "problems with hibernate logs" Watch "problems with hibernate logs" New topic
Author

problems with hibernate logs

Karol Oslowski
Ranch Hand

Joined: Jul 22, 2005
Posts: 51
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

Joined: Jul 20, 2005
Posts: 10111
    
165

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:



[My Blog] [JavaRanch Journal]
Karol Oslowski
Ranch Hand

Joined: Jul 22, 2005
Posts: 51
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

Joined: Jul 20, 2005
Posts: 10111
    
165

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

Joined: Jul 22, 2005
Posts: 51
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

Joined: Jul 20, 2005
Posts: 10111
    
165

Great

It didn't occur to me that you might be using JPA and not hibernate directly.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: problems with hibernate logs