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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:40:42+00:00 2026-05-28T06:40:42+00:00

I am using log4j for my application – there I need to see all

  • 0

I am using log4j for my application – there I need to see all log messages, so I defined

# General configuration
log4j.rootLogger = ALL, ConsoleAppender

# Appender configuration
log4j.appender.ConsoleAppender = org.apache.log4j.ConsoleAppender
log4j.appender.ConsoleAppender.layout = org.apache.log4j.PatternLayout
log4j.appender.ConsoleAppender.layout.ConversionPattern = %5p (%c) %m%n

But, after I started using Apache’s HTTPClient library (which is awesome btw), my console got clouded up by its logging – everything was logged and I am not able to see the log output from my own application any more.

So how can I tell the HTTPClient library that it should only log WARN messages, while my own application still logs on ALL levels?

I create my application logger using

Logger logger = Logger.getLogger(MyClass.class);
PropertyConfigurator.configure("log4j.properties");
  • 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-28T06:40:43+00:00Added an answer on May 28, 2026 at 6:40 am

    It’s quite simple. Just add the below line.

    log4j.logger.org.apache.commons.httpclient=WARN
    

    Similarly, you can configure levels for any package com.foo or class com.foo.Bar by appending it to the prefix log4j.logger as follows:

    log4j.logger.com.foo=MYLEVEL
    log4j.logger.com.foo.Bar=DEBUG
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application log (using log4j), I see a NullPointerException, but without the stack
A web application running in Websphere is using log4j SysLogAppender to log messages to
I'm building an executable jar-with-dependencies using maven. My application uses log4j and there's an
I have a java application using log4j SyslogAppender (facility=USER) and I can see using
I'm using log4j to log in application. Now the log file is created in
I want to maintain two Log Files in my web-application using apache Log4j.jar: 1)
So we have our J2EE application using Log4j like this public class CustomerController {
When using log4j, the Logger.log(Priority p, Object message) method is available and can be
I have sixteen servers using Log4J logs, accessible by ssh. I want to see
Using the xml configuration of log4cxx (which is identical in configuration to log4j). I

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.