Jeroen,

If you look at the log4j Filter class, there is an "OFF" level.  If you set
your logger level to this value, I'm sure it will fully disable all
messages.  You should still use the isEnabledXYZ() methods to determine if a
message should be logged or not.

Sorry, I had forgotten about the "ALL" and "OFF" levels.  I don't use them
very often myself.  Setting to FATAL is usually sufficient as I want to know
about those particular messages.

-Mark

> -----Original Message-----
> From: Frissaer, Jeroen [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 1:23 AM
> To: 'Log4J Users List'
> Subject: RE: Stopping logger
> 
> 
> Hi Mark,
> 
> Thanks for your answer.  Indeed this is what I am looking for, but the
> solutions doesn't convince me a 100%.  While setting the 
> priority level for
> a logger to a maximum, indeed most log statements will not be 
> outputed, and
> using isDebugEnabled() will not invoke some computational 
> effort.  But,
> isn't is possible to specify for some logger (and his 
> children)that logging
> is not allowed any more without touching the priority level.  Because
> setting the priority level to fatal will still not block the 
> logger activity
> entirely.
> 
> Jeroen
> 
> -----Original Message-----
> From: Mark Womack [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 24, 2002 6:45 PM
> To: 'Log4J Users List'
> Subject: RE: Stopping logger
> 
> 
> Jeroen,
> 
> Thanks for more details.
> 
> If you set the level of your TraceLogger logger to a very 
> high value, say
> "FATAL", then this will effectively block almost all of the 
> trace messages
> from TraceLogger and all of its "children".  Log4j supports 
> hierarchical
> settings for logger names.  So, settings to "TraceLogger" 
> affect any logger
> named "TraceLogger.XXX" where 'XXX' can be any string.
> 
> In your code, if you check if the level is enabled (ie 
> isDebugEnabled(),
> etc) before logging the message, then this will effectively 
> stop a message
> from being logged and conserve computational effort at the source.
> 
> Let me know if this is not what you were looking for.
> -Mark
> 
> > -----Original Message-----
> > From: Frissaer, Jeroen [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 24, 2002 1:38 AM
> > To: 'Log4J Users List'
> > Subject: RE: Stopping logger
> > 
> > 
> > Mark,
> > 
> > Sorry for not making myself clear.  Here is what I mean:
> > I have set the root category to the NullAppender.
> > Then I have created two Loggers in my XML properties file : 
> > EventLogger and
> > TraceLogger that each refer to their own appender.
> > 
> > In my Java Classes I create loggers with names likes this:
> > EventLogger.NameOfClass
> > TraceLogger.NameOfClass
> > 
> > So all these loggers inherit from the EventLogger or the 
> TraceLogger.
> > 
> > What I want to know is, if it is possible to block for example the
> > TraceLogger logger and with this all his children 
> (TraceLogger.Child1,
> > TraceLogger.com.Child2, ...), without blocking my EventLogger 
> > logger and his
> > children (EventLogger.Child1, EventLogger.com.org.Child2, 
> > ...) and without
> > having to use a NullAppender because this will still invoke 
> > computational
> > effort.
> > 
> > Hope this explains it more clearly and thanks for your answers.
> > Jeroen
> > 
> > 
> > -----Original Message-----
> > From: Mark Womack [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 23, 2002 8:32 PM
> > To: 'Log4J Users List'
> > Subject: RE: Stopping logger
> > 
> > 
> > Jeroen,
> > 
> > When you say "children" from EventLogger or TraceLogger, what 
> > do you mean?
> > When you create the trace instance in your classes, what do 
> > you pass in as
> > the logger name?  The class name?  Can you give some examples 
> > of names that
> > are passed?
> > 
> > -Mark
> > 
> > > -----Original Message-----
> > > From: Frissaer, Jeroen [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, May 23, 2002 8:45 AM
> > > To: Log4j Mailing List (E-mail)
> > > Subject: Stopping logger
> > > 
> > > 
> > > Hi everyone,
> > > 
> > > I'm using a whole bunch of loggers that are children from 
> > > EventLogger or
> > > TraceLogger.
> > > How can I for example stop the logging activity of all 
> > > loggers that inherit
> > > from the EventLogger?
> > > 
> > > I know you can shut down logging entirely for all loggers, 
> > > but that is not
> > > what I want because than also my loggers that inherit from 
> > > TraceLogger will
> > > be blocked.  I can also reference the EventLogger to a 
> > > NullAppender but this
> > > will still incure some computational cost for every log 
> > > statement made.
> > > 
> > > Is there a way to stop all functioning of all loggers that 
> > > inherit from some
> > > base logger without touching all other loggers and 
> without spending
> > > "computational energy"??
> > > 
> > > Thanks in advance
> > > Jeroen
> > > 
> > > --
> > > 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]>
> > 
> > --
> > 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]>
> 
> --
> 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]>

Reply via email to