开发者

Log4j Multiple Threads

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 con开发者_StackOverflow中文版figuration? How can I debug this?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜