简体   繁体   中英

All appenders for log4J

I try to run a medium sized programm with a lot of external jars but I always get the warning "log4j:WARN No appenders could be found for logger XYZ". Sure, I have to add the specific Appender to my log4j.properties but if I add this one, next run misses another one.

So, is there any way to find all needed appenders in external jars besides starting, adding appender, starting, adding appender.. and so on until there is no more warning?

You can either configure root logger which is a parent of all other loggers:

log4j.rootLogger=DEBUG, Appender

or configure most common top level loggers like com , org and net .

You can set up the log4j.properties file for the root logger. After that, all other loggers will "inherit" those properties and you will not get any more messages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM