Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does "additivity" flag in log4j.properties work only with log4j or with Apache Commons Logging as well?

7 views
Skip to first unread message

Gianni Galore

unread,
Sep 8, 2010, 5:26:42 AM9/8/10
to
In a java class I created a (simplified) logger as follows:

package aaa;
...
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class bbb {
....
private final Log log = LogFactory.getLog(getClass());
// or
private final Log log = LogFactory.getLog("aaa.bbb");

log.info("hello");
}

In the log4j.properties I defined:

log4j.rootLogger=INFO, console, logfile
log4j.additivity.aaa.bbb=false
log4j.additivity.aaa=false
log4j.appender.aaa.bbb=org.apache.log4j.RollingFileAppender
log4j.appender.aaa.bbb=C:/logs/mylog.txt
.....


Unfortunately the log output goes always to all appenders from RootLogger and not to the special logfile
for my particular module.

Why?

Does the additivity flag apply only to pure log4j Loggers rather than Apache Commons Logging?

Gianni

0 new messages