Shouldn't PropertyConfiguration report this as an error? []'s Daniel Serodio
On Wed, 2003-01-22 at 17:43, Ebersole, Steven wrote: > additivity is an attribute of the logger/category, not the appender... > > > As such, instead of: > log4j.category.com.printrak.me4=DEBUG, R4 > log4j.additivity.R4=false > you want: > log4j.category.com.printrak.me4=DEBUG, R4 > log4j.aditivity.com.printrak.me4=false > > > > > |-----Original Message----- > |From: Evans Mark-PT1167 [mailto:[EMAIL PROTECTED]] > |Sent: Wednesday, January 22, 2003 1:12 PM > |To: 'Log4J Users List' > |Subject: additivity in PropertyConfigurator > | > | > |I need help setting the additivity in my log4j properties > |file. (It doesn't seem to be working for me.) > | > |I want to log a specific class (logger) to one file, (and > |in my example below log a second class (logger) to another > |file), while logging the rest of my classes to a third > |file (root logger). > | > |I'm using a PropertyConfigurator. However, when I set > |"additivity" on my category, per documentation, I still > |get all messages going to the root logger's file. > | > |I'm following the example at > |http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/P > |ropertyConfigurator.html > | > |which shows: > |log4j.additivity.SECURITY=false > | > |Additional additivity information is found at > |http://jakarta.apache.org/log4j/docs/manual.html#additivity > | > |where it states: > | > | Appender Additivity > | The output of a log statement of logger C will > |go to all the appenders in C and its ancestors. This is > |the meaning of the term "appender additivity". > | However, if an ancestor of logger C, say P, has > |the additivity flag set to false, then C's output will be > |directed to all the appenders in C and it's ancestors upto > |and including P but not the appenders in any of the > |ancestors of P. > | Loggers have their additivity flag set to true > |by default. > |which imply that the ancestor "P", when his additivity is > |set to false, STILL logs messages, but doesn't pass them > |to the parent. So, I guess if you set additivity on your > |logger "C", C messages will be logged, but not passed up > |to parents. (I think that's what I'm doing...) > | > |Here's the details, thanks for any help. --Mark > | > | > | > | > |I'm logging logger3 to log4j.3.log. > |I'm logging logger4 to log4j.4.log. > |I'm logging the root category to log4j.log (here are the > |messages I believe don't belong.) > | > |Code: > |... > | static Category logger3 = > |Category.getInstance("com.printrak.me3"); > | static Category logger4 = > |Category.getInstance("com.printrak.me4"); > |... > | PropertyConfigurator.configure("log4j.properties"); > | > | > | logger3.debug("This is debug to logger3/me3."); > | logger4.debug("This is debug to logger4/me4."); > |... > | > | > |log4j.3.log: > |2003-01-22 11:00:14,896 DEBUG [main] - This is debug to > |logger3/me3. > | > |log4j.4.log: > |2003-01-22 11:00:14,906 DEBUG [main] - This is debug to > |logger4/me4. > | > |log4j.log: (why are these here with additivity set to false?) > |2003-01-22 11:00:14,896 DEBUG [main] - This is debug to > |logger3/me3. > |2003-01-22 11:00:14,906 DEBUG [main] - This is debug to > |logger4/me4. > | > | > |Configuration file: > | > |log4j.rootCategory=WARN, R > | > |log4j.category.com.printrak.me3=DEBUG, R3 > |log4j.category.com.printrak.me4=DEBUG, R4 > | > |log4j.category.com.printrak=DEBUG > | > |# Pattern to output the caller's file name and line number. > | > |log4j.appender.R=org.apache.log4j.FileAppender > |log4j.appender.R.File=log4j.log > |og4j.appender.R.layout=org.apache.log4j.PatternLayout > |log4j.appender.R.layout.ConversionPattern=%d %5p [%t] - %m%n > | > |log4j.appender.R3=org.apache.log4j.FileAppender > |log4j.appender.R3.File=log4j.3.log > |log4j.appender.R3.layout=org.apache.log4j.PatternLayout > |log4j.appender.R3.layout.ConversionPattern=%d %5p [%t] - %m%n > |log4j.additivity.R3=false > | > |log4j.appender.R4=org.apache.log4j.FileAppender > |log4j.appender.R4.File=log4j.4.log > |#log4j.appender.R4.DatePattern='.'yyyy-MM-dd > |log4j.appender.R4.layout=org.apache.log4j.PatternLayout > |log4j.appender.R4.layout.ConversionPattern=%d %5p [%t] - %m%n > |log4j.additivity.R4=false > | > |log4j.category.org.jboss=WARN > |log4j.category.com.printrak=DEBUG > | > | > |-- > |To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- Daniel Serodio <[EMAIL PROTECTED]> CheckForte -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>