logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "None None" <japp...@hotmail.com>
Subject RE: SMTPAppender only for ERROR and FATAL?
Date Fri, 08 Oct 2004 21:32:31 GMT
Ok I got it to work. I had my Evaluator class as part of my Custom Level 
class.

So I moved to it's own file and declared it public!

>From: "Scott Deboy" <sdeboy@comotivsystems.com>
>Reply-To: "Log4J Users List" <log4j-user@logging.apache.org>
>To: "Log4J Users List" <log4j-user@logging.apache.org>
>Subject: RE: SMTPAppender only for ERROR and FATAL?
>Date: Fri, 8 Oct 2004 13:23:40 -0700
>
>You write the evaluator yourself, include it in your classpath and specify 
>it in the config file.
>
>Click on the link to TriggeringEventEvaluator in the SMTPAppender javadoc - 
>that will explain.
>
>OK, here's the link: 
>http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/TriggeringEventEvaluator.html
>
>Your evaluator is called each time an event is processed by the appender to 
>see if the event will trigger the send of the email.
>
>The body of your TriggeringEventEvaluator could have:
>
>return true;
>
>to have SMTPAppender send an email with every event evaluated by the 
>evaluator.
>
>
>-----Original Message-----
>From:	None None [mailto:jappdev@hotmail.com]
>Sent:	Fri 10/8/2004 1:00 PM
>To:	log4j-user@logging.apache.org
>Cc:
>Subject:	RE: SMTPAppender only for ERROR and FATAL?
>Sorry I dont want to be stupid and I dont want to get RTFM
>
>It's the first time I use log4j what class is this? Where do I get this
>evaluator class name? And what does it have to do with the fact that SMTP
>appender only sends if the level is ERROR or FATAL?
>
>Thanks
>
>
> >From: "Scott Deboy" <sdeboy@comotivsystems.com>
> >Reply-To: "Log4J Users List" <log4j-user@logging.apache.org>
> >To: "Log4J Users List" <log4j-user@logging.apache.org>
> >Subject: RE: SMTPAppender only for ERROR and FATAL?
> >Date: Fri, 8 Oct 2004 12:48:31 -0700
> >
> >The fully qualfied class name of an evaluator that you provide.
> >
> >
> >-----Original Message-----
> >From:	None None [mailto:jappdev@hotmail.com]
> >Sent:	Fri 10/8/2004 12:43 PM
> >To:	log4j-user@logging.apache.org
> >Cc:
> >Subject:	RE: SMTPAppender only for ERROR and FATAL?
> >So according to that I have to....
> >
> ><appender name="email" class="org.apache.log4j.net.SMTPAppender">
> >	<param name="SMTPHost" value="SECORD"/>
> >	<param name="EvaluatorClass" value=""/>
> >	<param name="From" value="Application"/>
> >	<param name="To" value="dood@dood.com"/>
> >	<param name="Subject" value="Information"/>
> >	<layout class="org.apache.log4j.PatternLayout">
> >		<param name="ConversionPattern" value="%-4r %-5p [%t] %37c %3x - 
>%m%n"/>
> >	</layout>
> ></appender>
> >
> >What do I put for the value? Thanks
> > >From: "Scott Deboy" <sdeboy@comotivsystems.com>
> > >Reply-To: "Log4J Users List" <log4j-user@logging.apache.org>
> > >To: "Log4J Users List" <log4j-user@logging.apache.org>
> > >Subject: RE: SMTPAppender only for ERROR and FATAL?
> > >Date: Fri, 8 Oct 2004 12:27:01 -0700
> > >
> > >Javadoc here:
> > 
> >http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html
> > >
> > >If you are not providing an EvaluatorClass param you are using the
> >default
> > >evaluator.
> > >
> > >
> > >-----Original Message-----
> > >From:	None None [mailto:jappdev@hotmail.com]
> > >Sent:	Fri 10/8/2004 12:02 PM
> > >To:	log4j-user@logging.apache.org
> > >Cc:
> > >Subject:	SMTPAppender only for ERROR and FATAL?
> > >Am trying to set up a logger so I can send e-mails on speciffic events.
> > >Though it only seems an e-mail gets sent if the level is error, fatal 
>and
> > >above.
> > >
> > >So I get my logger.... and call myLogger.info("bla"); I get no 
>e-mail....
> > >So then I change it to myLogger.fatal("bla"); and and I get an e-mail!
> > >
> > >Below is my config file
> > >
> > ><?xml version="1.0" encoding="UTF-8" ?>
> > ><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> > >
> > ><log4j:configuration>
> > >	<appender name="console" class="org.apache.log4j.ConsoleAppender">
> > >		<layout class="org.apache.log4j.PatternLayout">
> > >			<param name="ConversionPattern" value="%-4r %-5p [%t] %37c %3x -
> >%m%n"/>
> > >		</layout>
> > >	</appender>
> > >	<appender name="file" class="org.apache.log4j.RollingFileAppender">
> > >		<param name="File" value="C:\\Programming\\logs.txt"/>
> > >		<param name="MaxFileSize" value="2KB"/>
> > >		<param name="MaxBackupIndex" value="5"/>
> > >		<layout class="org.apache.log4j.PatternLayout">
> > >			<param name="ConversionPattern" value="%-4r %-5p [%t] %37c %3x -
> >%m%n"/>
> > >		</layout>
> > >	</appender>
> > >	<appender name="email" class="org.apache.log4j.net.SMTPAppender">
> > >		<param name="SMTPHost" value="SECORD"/>
> > >		<param name="From" value="Application"/>
> > >		<param name="To" value="dood@dood.com"/>
> > >		<param name="Subject" value="Information"/>
> > >		<layout class="org.apache.log4j.PatternLayout">
> > >			<param name="ConversionPattern" value="%-4r %-5p [%t] %37c %3x -
> >%m%n"/>
> > >		</layout>
> > >	</appender>
> > >	<root>
> > >		<level value ="INFO"/>
> > >		<appender-ref ref="email"/>
> > >	</root>
> > >
> > ></log4j:configuration>
> > >
> > >_________________________________________________________________
> > >Take charge with a pop-up guard built on patented Microsoft® 
>SmartScreen
> > >Technology.
> > 
> >http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> > >   Start enjoying all the benefits of MSN® Premium right now and get 
>the
> > >first two months FREE*.
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > >For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > >For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >_________________________________________________________________
> >MSN® Calendar keeps you organized and takes the effort out of scheduling
> >get-togethers.
> >http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> >   Start enjoying all the benefits of MSN® Premium right now and get the
> >first two months FREE*.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>_________________________________________________________________
>MSN® Calendar keeps you organized and takes the effort out of scheduling
>get-togethers.
>http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>   Start enjoying all the benefits of MSN® Premium right now and get the
>first two months FREE*.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org

_________________________________________________________________
Designer Mail isn't just fun to send, it's fun to receive. Use special 
stationery, fonts and colors. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines

  Start enjoying all the benefits of MSN® Premium right now and get the 
first two months FREE*.


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


Mime
View raw message