title: Enable Hibernate Startup log
body: <p>In book "Java Persistence with Hibernate" I came across a line that says:</p>
  
  <pre><code>Hibernate produces all trivial CRUD SQL at startup. It caches the SQL statements
  internally for future use, thus avoiding any runtime cost of SQL generation for the
  most common operations. 
  </code></pre>
  
  <p>To see the startup log, it says:</p>
  
  <pre><code>Enable DEBUG logging for the org.hibernate.persister.entity package, and watch (or search) the
  Hibernate startup log.
  </code></pre>
  
  <p>I have a trivial application with one entity Message that i'm persisting in the database. </p>
  
  <p>I have enable <code>show_sql=true</code> in my config file. You could see my config file below:</p>
  
  <pre><code>&lt;session-factory&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://127.0.0.1/ajax&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;XXXX&lt;/property&gt;
  
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;!-- Use the C3P0 connection pool provider --&gt;
      &lt;property name="hibernate.c3p0.min_size"&gt;5&lt;/property&gt;
      &lt;property name="hibernate.c3p0.max_size"&gt;20&lt;/property&gt;
      &lt;property name="hibernate.c3p0.timeout"&gt;300&lt;/property&gt;
      &lt;property name="hibernate.c3p0.max_statements"&gt;50&lt;/property&gt;
      &lt;property name="hibernate.c3p0.idle_test_period"&gt;3000&lt;/property&gt;
      &lt;!-- Show and print nice SQL on stdout --&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="format_sql"&gt;true&lt;/property&gt;
      &lt;!-- List of XML mapping files --&gt;
      &lt;mapping resource="org/myapp/hibernate/first/Message.hbm.xml" /&gt;
  &lt;/session-factory&gt;
  </code></pre>
  
  <p><strong>My Log4J.properties:</strong></p>
  
  <pre><code># Direct log messages to stdout
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.Target=System.out
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE}%5p %c{1}:%L - %m%n
  # Root logger option
  log4j.rootLogger=DEBUG, stdout
  # Hibernate logging options (INFO only shows startup messages)
  log4j.logger.org.hibernate=DEBUG
  # Log JDBC bind parameter runtime arguments
  log4j.logger.org.hibernate.type=DEBUG
  log4j.logger.org.hibernate.persister.entity=DEBUG
  log4j.logger.org.hibernate.SQL=DEBUG
  </code></pre>
  
  <p>With these settings, I could see the SQL getting printed on console when I save/update my entity.</p>
  
  <p>but what I do not see is Start up log (that I mentioned at top). Hibernate did generate the SQL, but not at the start of application, it happened only when I started dealing with Entities. </p>
  
  <p>What is wrong here?</p>