title: How do you configure logging in Hibernate 4 to use SLF4J
body: <p>Hibernate 3.x used <a href="/questions/tagged/slf4j" class="post-tag" title="show questions tagged &#39;slf4j&#39;" rel="tag">slf4j</a> for logging. Hibernate 4.x uses <a href="/questions/tagged/jboss-logging" class="post-tag" title="show questions tagged &#39;jboss-logging&#39;" rel="tag">jboss-logging</a>. I am writing a standalone application which uses Hibernate 4, and SLF4J for logging.</p>
  
  <p>How can i configure Hibernate to log to SLF4J?</p>
  
  <p>If that's not possible, how can i configure Hibernate's logging at all?</p>
  
  <p>The Hibernate 4.1 manual <a href="http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch03.html#configuration-logging" rel="noreferrer">section on logging</a> starts with the warning that it is ...</p>
  
  <blockquote>
    <p>Completely out of date. Hibernate uses JBoss Logging starting in 4.0. This will get documented as we migrate this content to the Developer Guide.</p>
  </blockquote>
  
  <p>... goes on to talk about SLF4J, and so is useless. Neither the <a href="http://docs.jboss.org/hibernate/orm/4.1/quickstart/en-US/html/" rel="noreferrer">getting started guide</a> nor the <a href="http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html/" rel="noreferrer">developer guide</a> talk about logging at all. Nor does the <a href="https://community.jboss.org/wiki/HibernateCoreMigrationGuide40" rel="noreferrer">migration guide</a>.</p>
  
  <p>I have looked for documentation on jboss-logging itself, but i haven't been able to find any at all. The <a href="https://github.com/jboss-logging/jboss-logging" rel="noreferrer">GitHub page is silent</a>, and JBoss's <a href="http://www.jboss.org/projects" rel="noreferrer">community projects page</a> doesn't even list jboss-logging. I wondered if th project's <a href="https://issues.jboss.org/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project%20=%20JBLOGGING%20AND%20resolution%20=%20Unresolved%20AND%20component%20is%20EMPTY%20ORDER%20BY%20priority%20DESC&amp;mode=hide" rel="noreferrer">bug tracker</a> might have any issues relating to providing documentation, but it doesn't.</p>
  
  <p>The good news is that when using Hibernate 4 inside an application server, such as JBoss AS7, logging is largely taken care of for you. But how can i configure it in a standalone application?</p>