1

I am adding ConsoleAppender to rootlogger for log4j as

BasicConfigurator.configure(new ConsoleAppender(layout, "System.err"));

But somehow log messages in some loggers down the hierarchy are not reaching console. I have not seen any instance in the hierarchy setting the additivity flag as false.

Some loggers are running in different threads, do you I need to do any configuration? How can I debug this?

0

1 Answer 1

4

Log4j is thread-safe. See Is log4j thread-safe?. You should not need any special configuration for multi-threading.

However, the messages can appear in a mixed-up order from different threads, so check that they aren't somewhere else in the logs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.