logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Usman Uppal" <uup...@salesforce.com>
Subject RE: LOG4NET - SMTP Appender Not Working
Date Wed, 28 Sep 2005 17:12:34 GMT
Ron, Yes setting buffer to 1 works on the third party server. I am
getting one email per line of information logging.

Why buffer size of 512 works from my pc and not the 3rd party server?
What should be appropriate buffer size?
usman

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Wednesday, September 28, 2005 12:57 PM
To: Log4NET User
Subject: RE: LOG4NET - SMTP Appender Not Working

Your had posted this earlier:

 <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
  <to value="uuppal@salesforce.com" />
  <from value="gordon.chan@logicacmg.com" />
  <subject value="ERROR - test Account Process Logging Message" />
  <smtpHost value="192.168.1.3" />
  <bufferSize value="512" />
  <lossy value="false" />
  <filter type="log4net.Filter.LevelRangeFilter">
   <param name="LevelMin" value="INFO"/>
   <param name="LevelMax" value="ERROR"/>
  </filter>
  <layout type="log4net.Layout.PatternLayout">
   <conversionPattern value="[%date]    %message" />
  </layout>
 </appender>

You are aware that no emails will be sent until 512 messages have been
queued up?

Are you able to send mail using these more general settings?

 <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
  <to value="uuppal@salesforce.com" />
  <from value="gordon.chan@logicacmg.com" />
  <subject value="ERROR - test Account Process Logging Message" />
  <smtpHost value="192.168.1.3" />
  <bufferSize value="1" />
  <layout type="log4net.Layout.SimpleLayout" />
 </appender>

--- Usman Uppal <uuppal@salesforce.com> wrote:

> Ron, I can send email using your sample code on hosted server. 
> 
>  
> 
>       using System.Web.Mail;
> 
>  MailMessage mailMessage = new MailMessage();
> 
>  mailMessage.To = "to@to.com";
> 
>  mailMessage.From = "from@from.com";
> 
>  mailMessage.Subject = "Subject";
> 
>  mailMessage.Body = "Hello World";
> 
>  SmtpServer.Send(mailMessage);
> 
>  
> 
>  
> 
> Any other suggestions?
> 
>  
> 
> Thanks,
> 
>  
> 
> Usman
> 
>  
> 
>  
> 
>  
> 
> -----Original Message-----
> From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
> Sent: Wednesday, September 28, 2005 11:33 AM
> To: Log4NET User
> Subject: RE: LOG4NET - SMTP Appender Not Working
> 
>  
> 
> I don't think you mentioned the part about the application being
> hosted
> 
> on a 3rd party server. Have you verified that you can send mail on
> that
> 
> server?
> 
>  
> 
>  using System.Web.Mail;
> 
>  MailMessage mailMessage = new MailMessage();
> 
>  mailMessage.To = "to@to.com";
> 
>  mailMessage.From = "from@from.com";
> 
>  mailMessage.Subject = "Subject";
> 
>  mailMessage.Body = "Hello World";
> 
>  SmtpServer.Send(mailMessage);
> 
>  
> 
> If you can't send mail, I would extend SmtpAppender and override the
> 
> SendBuffer method to use something like OpenSMTP:
> 
>  
> 
>  http://sourceforge.net/projects/opensmtp-net/
> 
>  
> 
> The new implementation would be very similiar to the base one:
> 
>  
> 
> http://tinyurl.com/a55ec
> 
>
http://cvs.apache.org/viewcvs.cgi/logging-log4net/src/Appender/SmtpAppen
> der.cs?rev=1.9&view=markup
> 
>  
> 
> On a slightly unreleated note, here's a screen shot of log4net's
> 
> SmtpAppender viewed from NLogViewer using nDumbster as a mock
> 
> SmtpServer (thanks to Jarek for cleaning up my code):
> 
>  
> 
>  http://www.ronosaurus.com/log4net/nlogviewer_ndumbster_log4net.png
> 
>  
> 
> That should be helpful in determining what a good bufferSize property
> 
> of the SmtpAppender is so it doesn't queue up messages for days then
> 
> suddenly attempt to send a giant 200mb email.
> 
>  
> 
> --- Usman Uppal <uuppal@salesforce.com> wrote:
> 
>  
> 
> > Ron, SMTP Appender works on my machine using our internal SMTP host
> 
> > but
> 
> > when I deploy my code on a hosted server (outside of our
> environment)
> 
> > that is using different SMTP host, it does not work.
> 
> > 
> 
> > Do we need to have Exchange CDO installed on the hosted server? Any
> 
> > other requirements that I should check for?
> 
> > 
> 
> > Thanks for your help.
> 
> > 
> 
> > Usman


Mime
View raw message