Log4net
  1. Log4net
  2. LOG4NET-180

SMTPAppender not sending all emails

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2 Maintenance Release
    • Component/s: Appenders
    • Labels:
      None
    • Environment:
      Windows XP with SP2, Visual Studio 2008 with SP1, C#, WCF

      Description

      I have a WCF IIS service application. hardly any of my SMTP emails are getting sent out. TO be sure that it isn't my SMTP server I created a console app that sends mail using System.Net.Mail and it works every time. I only have log4net configured for SmtpAppender.

      Here is the config.

      <log4net>
      <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender" >
      <to value="to@email.com" />
      <from value="from@email.com" />
      <smtpHost value="127.0.0.1" />
      <subject value="An exception occurred in Services." />
      <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
      </layout>
      <priority value="High" />
      </appender>
      <!--<root>
      <level value="ALL" />
      <appender-ref ref="SmtpAppender" />
      </root>-->
      <logger name="Services">
      <level value="All" />
      <appender-ref ref="SmtpAppender" />
      </logger>
      </log4net>

      PLUS

      <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />

      In my global asax I have

      void Application_Start(object sender, EventArgs e)

      { log4net.Config.XmlConfigurator.Configure(); }

      In my service implementation I have

      private static readonly log4net.ILog _Logger = log4net.LogManager.GetLogger("Services");

      Where I am telling log4net to do its magic is

      if (_Logger.IsErrorEnabled)
      _Logger.Error(formattedException, exception);

      I have no idea what this could be. I am brand new to log4net also.

      Thnaks

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Speranza
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development