Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I run hibernate annotations 3 without sl4j

 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using hibernate annotations v 3.4 and I run atest on below code-



The exception Iget is -


I understand AnnotationsConfiguration usses sl4j for logging -



Can i configure it to use log4j ?
Is it mandatory to add sl4j ?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am moving this topic to our Other Open Source Projects forum as this question relates to logging frameworks more than ORM.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sl4j is a logging abstraction it is not a logging framework. You can use whatever logging framework you would like but you must have sl4j on the classpath. If this is a new project I would recommend using Logback over log4j but either work with sl4j.

Here is a post where a portion discusses configuring sl4j and logback.

http://gordondickens.com/wordpress/2012/07/03/enterprise-spring-best-practices-part-1-project-config/#logging


here is a post describing lo4j with sl4j
http://www.mkyong.com/hibernate/how-to-configure-log4j-in-hibernate-project/


Conflicting versions of sl4j on the classpath will cause issues as well. The first link I posted shows how you can use the maven enforcer plugin to help with this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic