Hi all,
I've tried finding an answer on the net, but it's kind of hard finding
anything about this problem when searching for additivity and log4j ;)
I'm trying to configure log4j with an XML file using Joran configurator,
and mostly it works fine. However, it looks like it will not allow me to
set the additivity for the org.apache.log4j logger to false. I'm using
the following XML:
<logger name="org.apache.log4j" additivity="false">
<appender-ref ref="LOGGINGROLL" />
<level value="INFO" />
</logger>
In the same file, I configure another logger in exactly the same way
(with the same appender, which is a rolling file appender), but it's in
my own logger hierarchy. It has no problem at all having its additivity
set. Also, when I set the logging level of the Log4J hierarchy to DEBUG,
Joran configurator tells me it's setting the additivity for
org.apache.log4j to false, just like I asked it to.
However, when I test the value of the additivity by retrieving the
logger with Logger.getLogger("org.apache.log4j"); and then calling
getAdditivity() on the logger object I get back, it tells me the
additivity is set to true. It almost looks like the additivity is being
reset some time after the configurator has done its work.
Best regards,
Eelke Blok