Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7824029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:27:25+00:00 2026-06-02T08:27:25+00:00

I am using JpaTransactionManager with hibernate 3 inside spring 3.5 container. I am not

  • 0

I am using JpaTransactionManager with hibernate 3 inside spring 3.5 container. I am not able to enable logging for JPA. I wish to see the logs for transaction management for debugging some of my services. I am using log4j.

Here is what I have in my log4j.properties

# For JPA
log4j.logger.org.springframework.orm.jpa=DEBUG
log4j.logger.org.springframework.orm.jpa.JpaTransactionManager=DEBUG
log4j.logger.org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter=DEBUG
log4j.logger.org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean=DEBUG
log4j.logger.org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor=DEBUG
log4j.logger.org.springframework.transaction=DEBUG
log4j.logger.org.springframework=DEBUG
log4j.logger.org.hibernate=DEBUG
log4j.logger.org.hibernate.SQL=DEBUG

# Redirect log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=C:\\apps\application.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

# 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=ALL, file
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:27:26+00:00Added an answer on June 2, 2026 at 8:27 am

    Here is what worked for me in terms of enabling logging for JPATransactionManager:
    1. Download logback jars (logback-classic-1.0.1.jar, logback-core-1.0.1.jar) and put in classpath. Since I am using SLF4J, I also have log4j-over-slf4j-1.6.4.jar and slf4j-api-1.6.4.jar.
    2. Use following logback.xml (in WEB-INF/classes) for configuration:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>
                %d %p [%c] - &lt;%m&gt;%n
            </pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>DEBUG</level>
        </filter>
    </appender>
    
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${catalina.home}/logs/application.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${catalina.home}/logs/application-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>20MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    
        <encoder>
            <pattern>
                %d %p [%c] - &lt;%m&gt;%n
            </pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>ALL</level>
        </filter>
    </appender>
    
    <logger name="org.hibernate.transaction.JDBCTransaction" level="DEBUG"/>
    <logger name="org.hibernate.jdbc.ConnectionManager" level="DEBUG"/>
    <logger name="org.springframework.orm.jpa.JpaTransactionManager" level="DEBUG"/>
    
    <root level="ERROR">
        <appender-ref ref="FILE"/>
    </root>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application using Tomcat/Spring 3/JPA/Hibernate but my merges do not commit to
I'm trying to setup Spring using Hibernate and JPA, but when trying to persist
I am using Spring + JPA + Hibernate + EntityManager to talk to the
Using Spring : can jta-transaction-manager use id as name so that I can pass
I have a web application using JPA and JTA with Spring. I would like
I am new to Spring and hibernate please help, I am using (Jboss 6.0
I am trying to configure Spring3 + JPA using Hibernate, but I am getting
I'm using Hibernate 3.6.9 with Atomikos and Spring 3.1. After reading Where does the
Using Nunit, I want to be able to write a test fixture that will
Using a restful resource in Rails, I would like to be able to insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.