Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Does "additivity" flag in log4j.properties work only with log4j or with Apache Commons Logging as well? (http://www.velocityreviews.com/forums/t732778-does-additivity-flag-in-log4j-properties-work-only-with-log4j-or-with-apache-commons-logging-as-well.html)

Gianni Galore 09-08-2010 09:26 AM

Does "additivity" flag in log4j.properties work only with log4j or with Apache Commons Logging as well?
 
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.RollingFil eAppender
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



All times are GMT. The time now is 05:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57