Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Does "additivity" flag in log4j.properties work only with log4j or with Apache Commons Logging as well?

Reply
Thread Tools

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

 
 
Gianni Galore
Guest
Posts: n/a
 
      09-08-2010
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
log4j/commons-logging issue? Facade Java 3 10-11-2008 09:26 PM
why "package org.apache.commons.io" does not exist? www Java 2 08-22-2007 08:34 AM
Apache FileUpload - java.lang.NoClassDefFoundError: org/apache/commons/io/FileCleaner kebabkongen@hotmail.com Java 2 03-16-2006 09:20 AM
commons and log4j initializing in other web server applications gimme_this_gimme_that@yahoo.com Java 0 11-18-2005 02:14 AM
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory greg.knaddison@gmail.com Python 1 06-22-2004 10:58 PM



Advertisments