Hi ,
I tried it with BufferingForwardingAppender , it has the buffersize but no
time limit. My requirement is sending mail if 20 errors are logged within 5
min.
<appender name="BufferingForwardingAppender"
type="log4net.Appender.BufferingForwardingAppender" >
<bufferSize value="20" />
<lossy value="true" />
<evaluator type="log4net.Core.LevelEvaluator">
<threshold value="Error"/>
</evaluator>
<appender-ref ref="EventLogAppender" />
</appender>
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
<param name="LogName" value="PWebLogs" />
<param name="ApplicationName" value="Test" />
<filter type="log4net.Filter.LevelRangeFilter">
<acceptOnMatch value="true" />
<levelMin value="INFO" />
<levelMax value="FATAL" />
</filter>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
</layout>
</appender>
Thanks,
From: Ron Grabowski [mailto:[email protected]]
Sent: Thursday, October 27, 2011 8:04 PM
To: Log4NET User
Subject: Re: Email alert from log4net
You could extend BufferingForwardingAppender to wrap your original appender and
add logic for sending mail when there's too much traffic after inspecting the
buffer and to stop messages from forwarding until a certain timeout period has
passed.
________________________________
From: "Venkatasamy, Vanitha"
<[email protected]<mailto:[email protected]>>
To: Log4NET User
<[email protected]<mailto:[email protected]>>
Sent: Thursday, October 27, 2011 11:37 AM
Subject: Email alert from log4net
Hi ,
I need some idea to implement the following requirement in the web application .
I am using log4net in a custom dll to log the errors. I completed the log4net
implementation and its working fine.[aspx errors are logged in Event Log and
the asp errors are logged in FileAppender] .All the .loggerError() methods are
in the custom dll.
Now I want to monitor the logging, suppose if there is a situation like the
.loggerError() method is called more than 10 times in just 15 mins because of
Fatal error or if database is down, then I want to track that and send email to
admin. Is anybody implemented similar requirement or is there any solution in
Log4net.
________________________________
This message contains Devin Group confidential information and is intended only
for the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail
in error and delete this e-mail from your system. E-mail transmissions cannot
be guaranteed secure, error-free and information could be intercepted,
corrupted, lost, destroyed, arrive late, incomplete, or contain viruses. The
sender therefore does not accept liability for errors or omissions in the
contents of this message which may arise as result of transmission. If
verification is required please request hard-copy version.
________________________________
This message contains Devin Group confidential information and is intended only
for the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail
in error and delete this e-mail from your system. E-mail transmissions cannot
be guaranteed secure, error-free and information could be intercepted,
corrupted, lost, destroyed, arrive late, incomplete, or contain viruses. The
sender therefore does not accept liability for errors or omissions in the
contents of this message which may arise as result of transmission. If
verification is required please request hard-copy version.