logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From otisg <ot...@ureach.com>
Subject Re: Re: Using "&lt;level&gt;" (was: Re: Re: Appender logging to 2 logs - how to stop it)
Date Tue, 11 Nov 2003 11:13:35 GMT
Thank you Jacob/Jake, this helped a lot.

Otis




________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


---- On Mon, 10 Nov 2003, Jacob Kjome (hoju@visi.com) wrote:

> At 08:40 AM 11/10/2003 -0500, you wrote:
> >Hello,
> >
> >One more question about the use of "<level>" element.
> >What is its parent element?
> 
> <logger> or <root> (which is the root <logger>)
> 
> >Also, I thought that one controls the level at which logging
> >should start by using <appender>'s <param> sub-element, like
> >this:
> >
> ><appender name="........" class=".......">
> >   <param name="Threshold" value="INFO"/>
> >   ...
> ></appender>
> >
> >I thought this meant "log at INFO level or above (WARN,
ERROR,
> >FATAL), but do not log below it (DEBUG)".
> >
> >Am I wrong?
> 
> Not completely.  These are slightly different concepts,
though.  <level> is 
> used to set the logger priority where using threshold on an
appender 
> creates a filter for loggers with certain levels.  The
threshold filter is 
> useful when defining multiple appenders for a logger or set of

> loggers.  You do the same sort of filtering if you create an
appender 
> without a threshold filter and use...
> 
> <root>
>      <level value="info"/>
>      <appender-ref ref="myappender"/>
> </root>
> 
> >Is that actually dictated by the <level> element?  If so,
what
> >is the purpose of this Threshold parameter?
> 
> see above.
> 
> >Thank you,
> >Otis
> 
> Jake
> 
> 
> 
> 
> 
> >________________________________________________
> >Get your own "800" number
> >Voicemail, fax, email, and a lot more
> >http://www.ureach.com/reg/tag
> >
> >
> >---- On Fri, 07 Nov 2003, Jacob Kjome (hoju@visi.com) wrote:
> >
> > >
> > > 1.  You should use <logger>, not <category>
> > > 2.  If you don't want to inherit logging from the <root>
> >logger, you should
> > > add additivity="false" to the UserTracker <logger>
> > > 3.  You might want to set the <level>'s you prefer as
well
> > >
> > > Jake
> > >
> > > At 12:06 PM 11/7/2003 -0500, you wrote:
> > > >Hello,
> > > >
> > > >I am using log4j 1.2.8 (under JBoss).  I'm having a
problem
> >with
> > > >one of my Appenders logging to multiple log files, even
> >though I
> > > >didn't configure it to do this.
> > > >
> > > >Here is how I configured it:
> > > >
> > > ><appender name="MyUserTracker"
> > > >class="..DailyRollingFileAppender">
> > > >   <param name="File" value="/....../tracker.log"/>
> > > >   <param name="Threshold" value="INFO"/>
> > > >   <param name="Append" value="true"/>
> > > >   <param name="DatePattern" value="......"/>
> > > >
> > > >   <layout class="org.....">
> > > >     <param name="ConversionPattern" value="...."/>
> > > >   </layout>
> > > ></appender>
> > > >
> > > ><category name="UserTracker">
> > > >   <appender-ref ref="MyUserTracker"/>
> > > ></category>
> > > >
> > > >
> > > >That is it.
> > > >
> > > >The log4j.xml also contains configs for several other
> >appenders,
> > > >and contains this:
> > > >
> > > ><root>
> > > >   <appender-ref ref="CONSOLE"/>
> > > >   <appender-ref ref="FILE"/>
> > > ></root>
> > > >
> > > >CONSOLE is a ConsoleAppender catching System.out and FILE
is
> >a
> > > >DailyRollingFileAppender going to a different log file.
> > > >
> > > >
> > > >It seems to me like messages going to my UserTracker
> >appender
> > > >are somehow getting saved into the CONSOLE appender.
> > > >Nothing in my code prints to System.out.
> > > >
> > > >I have not been able to figure this out for a looong
time.
> > > >Does anyone know how to prevent this from happening?
> > > >
> > > >Thanks,
> > > >Otis
> > > >
> > > >
> > > >________________________________________________
> > > >Get your own "800" number
> > > >Voicemail, fax, email, and a lot more
> > > >http://www.ureach.com/reg/tag
> > > >
> > >
> >
>---------------------------------------------------------------------
> > > >To unsubscribe, e-mail:
> >log4j-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail:
> >log4j-user-help@jakarta.apache.org
> > >
> > >
> > >
>
>---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> >log4j-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> >log4j-user-help@jakarta.apache.org
> > >
> > >
> > >
> >
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
log4j-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail:
log4j-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
log4j-user-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message