How to avoid writing messages to the root logger in log4j v.1
问题 Is some path to write log messages only to the 'child' logger, avoiding root logger? The root logger is using by other components, so there is no ability to decrease it's level or disable appender. thanks 回答1: Please use Log4j additivity. Set the additivity property of a Log4j logger to false and then the log messages which are coming to that logger will not be propagated to parent loggers. Log4j configuration file: log4j.category.com.demo.moduleone = INFO, moduleOneFileAppender log4j