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

  • Home
  • SEARCH
  • 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

In log4j, I need to use Logger.getLogger(MyClass.class); I want to know what is the
Our app servers (weblogic) all use log4j to log to the same file on
I have a java main application, and I want to use log4j. I don't
What should we use in jboss-log4j.xml in order to turn on/off traces for our
I have to deploy a web app and the the log4j.properties file is created
Here is my log4j.properties file # Set loggers' levels log4j.rootLogger=warn, trace_file # Appender log4j.appender.trace_file=org.apache.log4j.RollingFileAppender
I need to use log4j in my application, but I don't know how I
I'm using Log4j in a application in which I also use Axis2 and Jetty
I have working web-application with applicationContext.xml in WEB-INF/config/applicationContext.xml. Now i need to implement some
I'm trying to use log4j my log4j.propreties: log4j.rootLogger=DEBUG, out log4j.logger.org.springframework=INFO log4j.logger.org.apache.activemq=INFO log4j.logger.org.apache.activemq.spring=WARN log4j.logger.org.apache.servicemix=DEBUG, stdout

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.