Hi All,

 I have implemented Log4Net in my application which logs errors for  both ASPX 
and ASP .

I am using EventLogAppender and AppenderSkeleton[extended for sending alert 
emails when threshold ia reached ] for aspx as below.its working fine

<log4net debug="true">
            <appender name="sendAlertAppender" 
type="sendAlertAppender.MultiThresholdNotifyingAppender,sendAlertAppender">

            <LevelThreshold value="ERROR" />
             <appender-ref ref="EventLogAppender" />
            </appender>
            <appender name="EventLogAppender" 
type="log4net.Appender.EventLogAppender">
                  <param name="LogName" value="PortalWebLogs" />
                  <param name="ApplicationName" value="Portals" />
                  <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>
            <root>
                  <level value="ALL" />
                  <priority value="ERROR" />
                  <appender-ref ref="sendAlertAppender" />
                  <appender-ref ref="EventLogAppender" />
            </root>
      </log4net>

For ASP also , I am using the same method with RollingLogFileAppender ,but 
maintaing the separate config file in bin folder as below

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" 
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>
  <log4net debug="true">
    <appender name="sendAlertAppender" 
type="sendAlertAppender.MultiThresholdNotifyingAppender,sendAlertAppender">
      <LevelThreshold  value="ERROR"/>
      <appender-ref ref="RollingLogFileAppender"/>
    </appender>
    <appender name="RollingLogFileAppender" 
type="log4net.Appender.RollingFileAppender">
      <file value="C:\\TestProj\\TestLog.txt"/>
      <appendToFile value="true"/>
      <rollingStyle value="Size"/>
      <eventId value="5" />
      <eventCategory value="ErrorLogging" />
      <maxSizeRollBackups value="10"/>
      <maximumFileSize value="10MB"/>
      <staticLogFileName value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n"/>
      </layout>
    </appender>
    <root>
      <level value="ALL"/>
      <priority value="ERROR"/>
      <!--<level value="DEBUG"/>-->
      <appender-ref ref="sendAlertAppender"/>
      <appender-ref ref="RollingLogFileAppender"/>
    </root>
  </log4net>
  <appSettings>
    <add key="log4net.Internal.Debug" value="true"/>
  </appSettings>
</configuration>
</configuration>


The issue is the above is working fine for RollingLogFileAppender ,but 
sendAlertAppender is not working. If I add the below configuration in my 
web.config file the sendAlertAppender is working but not the 
RollingLogFileAppender .

<compilation>
    <buildProviders>
           <add extension=".asp" 
type="System.Web.Compilation.PageBuildProvider"/>
     </buildProviders>
</compilation>
 <httpHandlers>
            <add path="*.asp" verb="*" type="System.Web.UI.PageHandlerFactory" 
validate="true"/>
 </httpHandlers>

Any advice on this...

Thanks,
Vanitha


________________________________

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.

Reply via email to