logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg Jansen" <Georg.Jan...@FaktNet.com>
Subject RE: please verify my config file.
Date Tue, 21 Feb 2006 22:03:56 GMT
Stephan,

 

I was a bit fast in my previous response I didn't notice your <param
name="Threshold" value="IINFO">

 

But I guess you only wanted to see the INFO message, and not the WARN,ERROR
and FATAL? 

 

If that's the case, my second example with the filter should do the job.

 

 

Georg

http://www.l4ndash.com <http://www.l4ndash.com/>  - Log4Net Dashboard /
Log4Net Viewer

 

 

 

  _____  

From: Georg Jansen [mailto:Georg.Jansen@FaktNet.com] 
Sent: 21. februar 2006 22:57
To: 'Log4NET User'
Subject: RE: please verify my config file.

 

Stephen,

 

If you want to send INFO and higher (i.e. INFO, WARN, ERROR and FATAL) add a
threshold parameter to your smtp appender configuration

 

<threshold value="INFO" />

 

If you only want to send INFO messages you need to define a filter, and add
it to the smtp appender configuration

 

<filter type="log4net.Filter.LevelRangeFilter">
    <levelMin value="INFO" />
    <levelMax value="INFO" />
</filter>

 

 

 

Georg

http://www.l4ndash.com <http://www.l4ndash.com/>  - Log4Net Dashboard /
Log4Net Viewer

 

 

 

 

 

  _____  

From: Patten, Stephen [mailto:Stephen.Patten@impaccompanies.com] 
Sent: 21. februar 2006 22:32
To: Log4NET User
Subject: please verify my config file.

 

Hello group,

 

I'm having a problem where I'd like to limit the smpt appender to only send
INFO messages and thought I configured my file correctly. What am I doing
wrong?

 

 

Thank you,

Stephen

 

 

 

 

 

 

 

          <log4net>

                   <appender name="RollingFileAppender"
type="log4net.Appender.RollingFileAppender">

                             <file value="C:\\Logs\\ICLS.log" />

                             <appendToFile value="true" />

                             <rollingStyle value="Size" />

                             <maxSizeRollBackups value="10" />

                             <maximumFileSize value="500MB" />

                             <staticLogFileName value="true" />

                             <layout type="log4net.Layout.PatternLayout">

                                      <conversionPattern value="%date
[%thread] %-5level %logger [%ndc] - %message%newline" />

                             </layout>

                   </appender>

                   <appender name="HttpTraceAppender"
type="log4net.Appender.AspNetTraceAppender" >

                             <layout type="log4net.Layout.PatternLayout">

                                      <conversionPattern value="%date
[%thread] %-5level %logger [%ndc] - %message%newline" />

                             </layout>

                   </appender>

                   <appender name="UdpAppender"
type="log4net.Appender.UdpAppender">

                             <localPort value="80" />

                             <remoteAddress value="machinename" />

                             <remotePort value="8080" />

                             <layout
type="log4net.Layout.XmlLayoutSchemaLog4j">

                                      <locationInfo value="true" />

                             </layout>

                   </appender>

                   <appender name="SmtpAppender"
type="log4net.Appender.SmtpAppender,log4net">

                             <to
value="SharedServicesAutomationGroup@Domain.com" />

                             <from value="ICLS@domain.com" />

                             <subject value="logging message" />

                             <smtpHost value="domain.com" />

                             <param name="BufferSize" value="0" />

                             <param name="Lossy" value="false" />

                             <param name="Threshold" value="INFO" />

                             <layout
type="log4net.Layout.PatternLayout,log4net">

                                      <conversionPattern
value="%property{log4net:HostName} :: %level :: %message %newlineLogger:
%logger%newlineThread: %thread%newlineDate: %date%newlineNDC:
%property{NDC}%newline%newline" />

                             </layout>

                   </appender>

                   <root>

                             <level value="ALL" />

                             <appender-ref ref="RollingFileAppender" />

                             <appender-ref ref="HttpTraceAppender" />

                             <appender-ref ref="UdpAppender" />

                             <appender-ref ref="SmtpAppender" />

                   </root>

          </log4net>

 

 

 

 

Stephen Patten

Shared Services Technical Manager

Impac Mortgage Holdings, Inc.

949-274-1141 (Cell)

949-260-4533 (Office)

949-706-6329 (Fax)

 


Mime
View raw message