Hi all,

I have a question about starting(read configuring) log4j. I am trying to use
log4j with Weblogic and am using the 

Dlog4j.configuration=file:myfile#PropertyConfigurator

option when starting-up WebLogic. I want to know how to set it
up with the configureAndWatch option when starting up WebLogic?

Priyank


-----Original Message-----
From: Mark Masterson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 1:16 PM
To: LOG4J Users Mailing List
Subject: RE: modifying log levels through a management console


>>Is it more performant to set the log level via the Appender or via
Categories?<<

Ah, here I'm likely to get myself in trouble, as this is (for me, at least)
a subtle and complicated issue.

Short answer: I think that you would find that setting the priority at the
Category level is faster, in terms of absolute performance.  I would assume
this because, AFAIK, the "check" for the priority of a Category happens much
earlier in the sequence of events - assuming that a given priority is not
valid for a given Category, the logging process simply returns at the point
where it determines this.  Relying on the Appender "check", however, would
mean moving through a number of additional, interim steps in the sequence of
events (the instantiation of the Appender(s), etc.), which would naturally
take more time.  Is this significant?  Who knows?  Why don't you benchmark
it and let us know? ;-)

Longer answer: it seems to me that you're really asking two questions: the
above about performance, and a more general question to the effect of "which
technique is better under which circumstances?"  This more general question
is hard to answer - at least, I find it so.  To use the sample config file
you used in your mail, yes, you see no difference as configured.  Change the
Syslog Appender's threshold to ERROR, however, and you will see a
difference.  The result will be that your console appender will continue to
get all messages - DEBUG, INFO, ERROR, etc., while Syslog will only get
ERROR and higher.  In effect, the threshold parameter filters your output -
on the appender you use it on, you get the priority you set, *and all
priorities above it in the chain.*  If this is the kind of result you want,
then this is an easy way to achieve this, performance issues
notwithstanding.  If, however, you wanted something slightly different -
say, all messages for a given category going to the console, and all
messages for another category going to Syslog, then the appender threshold
won't help you.  Do you see what I mean?

--Mark


---------------------------------------------------------------------
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]

Reply via email to