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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:46:47+00:00 2026-05-18T23:46:47+00:00

Situation: I have this log4j logger: private static final Logger logger = Logger.getLogger(ThisClassName.class); And

  • 0

Situation: I have this log4j logger:

private static final Logger logger = Logger.getLogger(ThisClassName.class);

And am trying to set it programatically through:

Logger.getLogger(ThisClassName.class).setLevel(Level.DEBUG);

Still, DEBUG level prints are swalloed (while INFO prints are printed successfully).

Even this bit has no effect: Logger.getRootLogger().setLevel(Level.DEBUG);

Calling logger.debug(“foo”) reaches Category.forcedLog() and ConsoleAppender.doAppend(), and then fails (quits) at:

if(!isAsSevereAsThreshold(event.getLevel()))

Any idea why this is happening?

  • 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-18T23:46:47+00:00Added an answer on May 18, 2026 at 11:46 pm

    Your appender is configured with a threshold greater than debug, so while the logger doesn’t ignore the entries, your appender doesn’t record it. You need to configure the threshold of your ConsoleAppender to be DEBUG as well, either through your config file or programatically:

    ((ConsoleAppender)someLogger.getAppender("CONSOLE")).setThreshold(Level.DEBUG);
    

    Config files are usually the more elegant solution for this sort of thing.

    Edit: Note that apparently, any subclass of AppenderSkeleton (including ConsoleAppender) shouldn’t have a threshold filter set by default. So it’s likely that somewhere in your configuration you’re actually manually assigning a threshold ( > Debug) to that appender, as @justkt hints.

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

Sidebar

Related Questions

We have this situation: Window Keyboard ^ ^ | / ApplicationWindow so class Window
I have this situation: interface MessageListener { void onMessageReceipt(Message message); } class MessageReceiver {
i have situation like this: class IData { virtual void get() = 0; virtual
I have this situation: I have a class which keeps track of an array
I have this situation object SuperHorribleLongName { trait X { private[SuperHorribleLongName] def internalGaga() :
I have this situation: I am trying to remove an old avatar image for
I have this situation: My ModelView: public class Subject { public int ID {
i have this situation: type TWheel = record private type TWheelEnum = (whBA, whCA,
i have this situation: <div class=cont_picture> <?php echo <a id=\mine_click\ href=\#\ >a test</a>; ?>
i have this situation <div class=sub_project> <div class=sbone brown_gradient optzeci>Description</div> <div class=sbtwo optzecitwo> Lorem

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.