• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

problems with hibernate logs

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great

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