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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:59:23+00:00 2026-05-14T23:59:23+00:00

I use log4j as logger for my web application. in log4j, I can set

  • 0

I use log4j as logger for my web application. in log4j, I can set the level log in log4j properties or log4j.xml.
in log4j, we instance logger as follows:

static Logger logger = Logger.getLogger(SomeClass.class);

I init log4j basic configurator in a servlet file using init method.
But, I usually test application using JUnit, So I init the basic configurator in setup method. after that, I test the application, and I can see the log.

Because I deployed, the web in websphere. I change all of logging instance become:

private Log log = LogFactory.getLog(Foo.class);

I don’t know how to load basic configurator using ACL. so I can’t control debug level to my JUnit test.

do you have any suggestion, without changing

static Logger logger = Logger.getLogger(SomeClass.class); 

become

static Logger logger = Logger.getLogger(SomeClass.class);
  • 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-14T23:59:24+00:00Added an answer on May 14, 2026 at 11:59 pm

    What logging system you use as backend for Apache Commons Logging in Websphere in your unit tests? ACL is just a wrapper for other logging backends (such as log4j), and you configure logging level using backends configuration facilities.

    So I think you should just use log4j in your unit tests and use its basic configuration in setup methods.

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

Sidebar

Related Questions

We use Log4j (and Commons Logging) to log our error messages. Now we want
I have a Java web application that currently uses Log4J for logging. I'd like
I have to deploy a web app and the the log4j.properties file is created
Use case: 3rd party application wants to programatically monitor a text file being generated
I use emacs to edit my xml files (nxml-mode) and the files were generated
We have built a web application that accepts SOAP messages, does some processing, calls
I have a web-application written in java. I would like to run integration tests
I am trying to get my web application deployed on Websphere 6.1 to display
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
Use case: A does something on his box and gots stuck. He asks B

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.