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 670257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:14:33+00:00 2026-05-14T00:14:33+00:00

We use this Log4J config to display JTA info: <category name=org.springframework.transaction> <priority value=DEBUG/> </category>

  • 0

We use this Log4J config to display JTA info:

<category name="org.springframework.transaction">
    <priority value="DEBUG"/>
</category>

The resulting log entries are of the type:

15:36:08,048 DEBUG [JtaTransactionManager] [ ] Creating new transaction with name [class]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
15:36:09,564 DEBUG [JtaTransactionManager] [ ] Initiating transaction commit

… Now we use Spring’s MessageListener to listen to an MQ queue. Problem is this is transactional, and we get the aforementioned logging printed out every 2 seconds.

What we want, is just to have these JTA log statements printed out when someone uses our REST API to access services that utilize @Transactional. We don’t want the JTA log entries that come from this “polling” MQ listening implementation.

Can you do this?

  • 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-05-14T00:14:33+00:00Added an answer on May 14, 2026 at 12:14 am

    You should set the default log level higher than DEBUG in your configuration, then try adjusting the log level for org.springframework.transaction manually in your REST API inside the appropriate call., e.g.

    public void doSomething() {
        Logger txLogger = Logger.getLogger("org.springframework.transaction");
        Level defaultLevel = txLogger.getLevel();
        txLogger.setLevel(Level.DEBUG);
        // do my stuff
        txLogger.setLevel(defaultLevel);
    }
    

    This means that during the call to your API – but only then – the calls initiated by the MQ listener would also be logged, but AFAIK there is no way to configure different log levels for the same class depending on where it is called from 🙁

    Update: Another possibility would be to create a custom TransactionManager, which would be just a wrapper for the one provided by Spring. It would forward the calls to Spring and write its own logs. You would use that in your API but the Spring version in the MQ listener. Then you would have two distinct classes, so you could set different log levels. I am fairly sure this is possible, however it may be more hassle to configure and maintain than it is worth…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(This is on SLES11, Java 7, Tomcat 6, log4j-1.2.16) We use log4j to write
I use this : <?php foreach($_SERVER as $key => $value){ echo <b>$key:</b> $value<br>\n; }
I notice a number of java libraries use this as a suffix: log4j, couchdb4j,
I have this code with log4j, I don't use any kind of configuration files
I've set my log4j.properties file to this configuration below log4j.rootLogger=INFO, CATALINA # Define all
I use log4j for sending emails with exception. My log4j configuration: log4j.rootLogger=info, stdout, errmail
I don't want to use something like this : Logger.getLogger(MyClass.class).info(Info message); each time I
I have application which heavily use log4j out of the box. This uses lots
use this website a lot but first time posting. My program creates a number
I use this function for transforming URLs to images on output. function InsertLink(T){ var

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.