logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hu <xwhu_1...@yahoo.com>
Subject RE: Appenders
Date Fri, 05 Apr 2002 22:39:20 GMT
Thanks. But here is from the javadocs:

"Set the threshold priority. All log events with lower
priority than the threshold priority are ignored by
the appender."
So the priority higher than the Threshhold will still
be logged. That means the ERROR msg will still be
logged into the INFO msg file.

--- "Zeltser, Mark" <Mark.Zeltser@lehman.com> wrote:
> See inline.
> 
> -----Original Message-----
> From: xwhu_1999@yahoo.com
> [mailto:xwhu_1999@yahoo.com]
> Sent: Friday, April 05, 2002 4:24 PM
> To: Log4J Users List
> Subject: Re: Appenders
> 
> 
> Using Threshhold option the ERROR still goes to
> Console, right? 
> 
> 
> No, just take <appender-ref ref="STDOUT" /> out of
> your root element
> 
> 
> I would like to set up that in the
> same category, INFO goes to one file, ERROR goes to
> another file, so we can deal with the message
> differently.
> 
> 
> Reffer to 2 appenders in your category, first one
> will have threshold set to
> INFO and will write to 1st file, second will have
> threshold set to ERROR and
> will write to 2nd file
> 
> 
> Also, I have another question about the configure. I
> would like to log all the ERROR level msg in all our
> classes into one error log, and if any class need
> more
> infomation, that class can log into different log.
> In my following set up, the classes that dosen't
> have
> category, the ERROR msg is not written into the
> error
> log. How can I do it?
> 
> #################################
> 	<appender name="infoLog"
class="org.apache.log4j.FileAppender">
>             <param name="File" 
value="'c:/infologs/infolog.log" />
>             <param name="Append" value="true" />
>             <layout
class="org.apache.log4j.PatternLayout">
> 		<param name="ConversionPattern" value="%d -
%m%n"/>
>             </layout>
> 	</appender>
> 	<appender name="errorLog"
class="org.apache.log4j.FileAppender">
>             <param name="DatePattern"
value="'c:/errorlogs/errorlog.log" />
>             <param name="Append" value="true" />
> 	    <param name="Threshold" value="ERROR" />
>             <layout
class="org.apache.log4j.PatternLayout">
> 		<param name="ConversionPattern" value="%d [%t]
(%F:%L) - %m%n"/>
>             </layout>
> 	</appender>
> 	<appender name="email"
class="org.apache.log4j.SMTPAppender">
>             	<param name="SMTPHost"
value="mail.mydomain.com" />
> 		<param name="From" value="app@mydomain.com" />
> 		<param name="To" value="me@mydomain.com" />
> 		<param name="Subject" value="[App Alert]" />
> 		<layout class="org.apache.log4j.PatternLayout">
> 			<param name="ConversionPattern"
value="%d\t%p\t(%F:%L) %m%n"/>
> 		</layout>
> 	</appender>
> 	<appender name="STDOUT"
class="org.apache.log4j.ConsoleAppender">
> 		<layout class="org.apache.log4j.PatternLayout">
>                    <param name="ConversionPattern"
value="%d %-5p [%t] (%F:%L) - %m%n"/>
> 		</layout>
> 	</appender>
> 
> 	<category name="com.mydomain.myclass"
additivity="false">
> 	  <priority value="info" />
>   	  <appender-ref ref="infoLog" />
> 	</category>
> 	<category name="com.mydomain" additivity="false">
> 	  <priority value="error" />
>   	  <appender-ref ref="errorLog" />
> 	  <appender-ref ref="email" />
> 	</category>
> 	<root>
> 	   <priority value ="debug" />
>    	   <appender-ref ref="STDOUT" />
> 	</root>
> 
> Thanks
> 
> --- Benny Yu <blackrose_12@hotmail.com> wrote:
> > Hi,
> >
> >     I am trying to figure out how to assign
> > different log level to different
> > appenders for the same Category.  I want to be
> able
> > to log only ERROR level
> > to console appender but at the same time log DEBUG
> > in a file appender.
> > Could someone point me to the right direction in
> > accomplishing this.
> >
> > Thanks in advance,
> > Benny
> >
> >
>
_________________________________________________________________
> > Chat with friends online, try MSN Messenger:
> > http://messenger.msn.com
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:log4j-user-help@jakarta.apache.org>
> >
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> 
> --
> To unsubscribe, e-mail:  
> <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:log4j-user-help@jakarta.apache.org>
> 
> 
> 
>
------------------------------------------------------------------------------
> This message is intended only for the personal and
> confidential use of the designated recipient(s)
> named above.  If you are not the intended recipient
> of this message you are hereby notified that any
> review, dissemination, distribution or copying of
> this message is strictly prohibited.  This
> communication is for information purposes only and
> should not be regarded as an offer to sell or as a
> solicitation of an offer to buy any financial
> product, an official confirmation of any
> transaction, or as an official statement of Lehman
> Brothers.  Email transmission cannot be guaranteed
> to be secure or error-free.  Therefore, we do not
> represent that this information is complete or
> accurate and it should not be relied upon as such. 
> All information is subject to change without notice.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:log4j-user-help@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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


Mime
View raw message