• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Hibernate and java.util.Logging

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, ranchers!
I want to turn on sql logging using

How can I use a logger from JUL instead of log4j in that situation?
Thanks in advance.
 
Ranch Hand
Posts: 84
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello which version of hibernate are you using? i understand that the latest version uses sl4j that it's an API to made the logging pluggable and make hibernate to able to JUL or any other logging framework.
[ December 10, 2008: Message edited by: Angel Taveras ]
 
Max Vaha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Angel!
I am using 3.3.1 version. How can I plug JUL?
 
Angel Taveras
Ranch Hand
Posts: 84
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just use the JUL wrapper of sl4j. You should only add the sl4j JUL binding and that should do it,

Regards,
 
Max Vaha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I didn't found good examples about sl4j.

If I have a method:

How can I log generated sql query to the file "sql.log"?
 
Angel Taveras
Ranch Hand
Posts: 84
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you have to configure the logger using a property file (loggging.properties) preferably. You could configure a hibernate package to send it to the file sql.txt as you suggested. If you need more info to configure the JUL logger via a property file you can find it here,

i hope this helps,

Regards,
 
Max Vaha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
I think, if JUL requires .properties in that situation, I'll use log4j instead of it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic