title: Spring hibernate Transaction Logging
body: <p>how can we log spring Transaction mechanism. i am showing below example shown in <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/transaction.html#tx-decl-explained">Spring Doc sec 10.5.2</a>.if i want to logging upto this level how to do that </p>
  
  <p>i am using Spring,Hibernate and Log4j.</p>
  
  <pre><code>&lt;!-- the Spring container is starting up... --&gt;
  [AspectJInvocationContextExposingAdvisorAutoProxyCreator] - Creating implicit proxy
  for bean 'fooService' with 0 common interceptors and 1 specific interceptors
  &lt;!-- the DefaultFooService is actually proxied --&gt;
  [JdkDynamicAopProxy] - Creating JDK dynamic proxy for [x.y.service.DefaultFooService]
  &lt;!-- ... the insertFoo(..) method is now being invoked on the proxy --&gt;
  [TransactionInterceptor] - Getting transaction for x.y.service.FooService.insertFoo
  &lt;!-- the transactional advice kicks in here... --&gt;
  [DataSourceTransactionManager] - Creating new transaction with name    [x.y.service.FooService.insertFoo]
  [DataSourceTransactionManager] - Acquired Connection
  [org.apache.commons.dbcp.PoolableConnection@a53de4] for JDBC transaction
  &lt;!-- the insertFoo(..) method from DefaultFooService throws an exception... --&gt;
  [RuleBasedTransactionAttribute] - Applying rules to determine whether transaction should
  rollback on java.lang.UnsupportedOperationException
  [TransactionInterceptor] - Invoking rollback for transaction on x.y.service.FooService.insertFoo
  due to throwable [java.lang.UnsupportedOperationException]
  
  &lt;!-- and the transaction is rolled back (by default, RuntimeException instances cause rollback) --&gt;
  [DataSourceTransactionManager] - Rolling back JDBC transaction on Connection
  [org.apache.commons.dbcp.PoolableConnection@a53de4]
  [DataSourceTransactionManager] - Releasing JDBC Connection after transaction
  [DataSourceUtils] - Returning JDBC Connection to DataSource
  
  Exception in thread "main" java.lang.UnsupportedOperationException
  at x.y.service.DefaultFooService.insertFoo(DefaultFooService.java:14)
  &lt;!-- AOP infrastructure stack trace elements removed for clarity --&gt;
  at $Proxy0.insertFoo(Unknown Source)
  </code></pre>
  
  <p>Logging File..</p>
  
  <pre><code>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
  log4j.rootLogger=info, stdout
  log4j.category.org.springframework.transactions=DEBUG  
  </code></pre>