Hi Jason, This is not a solution or explanation, but perhaps you can craft a work-around from the following:
I also set the 'additivity' flag to false on a logger that is never explicitly instantiated, however in my case there is an appender attached to the logger, and this seems to work. Perhaps you can change your configuration approach slightly and choose to set 'additivity' flag to false on loggers one level lower in the hierarchy where you are specifying appenders. Cheers Adrian -----Original Message----- From: Jason [mailto:[EMAIL PROTECTED] Sent: 19 January 2004 04:55 To: [EMAIL PROTECTED] Subject: configuration additivity and sparse logger trees Log4j users-- I noticed something odd when I started configuring and testing log4j and thought I would run it across this mailing list to see what the response is... I chose to use log4j because of it's fine-grained logging control and the ability to turn logging on/off for various categories. I tried using the following configuration for my application: log4j.logger.ACCESS=ERROR, CONSOLE log4j.additivity.ACCESS.MyFunction=false log4j.logger.ACCESS.MyFunction.SubFunction1=INFO, LOGFILE1 log4j.logger.ACCESS.MyFunction.SubFunction2=DEBUG, LOGFILE2 This does not behave as I would expect it to, all the SubFunction1 and SubFunction2 calls are still going to the CONSOLE in addition to their log files. After a little digging through the source code, I realized that there is no logger created for "ACCESS.MyFunction", so the additivity property set above never gets used. I can resolve this by putting in an additional config line: log4j.logger.ACCESS.MyFunction=OFF Although this is a somewhat reasonable workaround, it is not ideal (I plan on having _many hundred_ levels where I would have to add these config directives) . I have to wonder if the code is functioning as designed or if this is an oversight? There is no comment on this in the online documentation, and the original configuration should logically work. Let me know what your thoughts are. Thanks, Jason --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
