Try adding a threshold node to the appender node:

 <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
  <threshold value="INFO"/>
  <subject value="Errors with WMSLogParser" />
  <to value="" />
  <from value="" />
  <smtpHost value="" />
  <authentication value="basic"/>
  <username value=""/>
  <password value=""/>
  <bufferSize value="512" />
  <layout type="log4net.Layout.PatternLayout">
   <conversionPattern 
    value="%message%newline" />
  </layout>
 </appender>

--- electroteque <[EMAIL PROTECTED]> wrote:

> 
> On 17/03/2006, at 11:42 AM, electroteque wrote:
> 
> > Hi there, I was wondering if there was a possibility of being able
> to 
> > log to file all levels except the debug level which i want the
> console 
> > only to display ? Also how is it possible to buffer all the logs
> going 
> > to smtp appender and send it once the program has finished or
> exiting 
> > with an error ? I only one to recieve one email not many really.
> Let 
> > me know.
> >
> >
> Here is my smtp config, the level is being ignored its sending all
> log 
> levels !
> 
> <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
>                       <subject value="Errors with WMSLogParser" />
>                       <to value="" />
>                       <from value="" />
>                       <smtpHost value="" />
>                       <authentication value="basic"/>
>                       <username value=""/>
>                       <password value=""/>
>                       <bufferSize value="512" />
>                       <lossy value="false" />
>                       <evaluator type="log4net.Core.LevelEvaluator">
>                               <threshold value="ERROR"/>
>                       </evaluator>
>                       <layout type="log4net.Layout.PatternLayout">
>                               <conversionPattern value="%newline%d{dd MMM 
> yyyy HH:mm:ss} 
> [%thread] %-5level %logger - %message%newline%newline%newline" />
>                       </layout>
>               </appender>
> 

Reply via email to