Last post Mar 22, 2011 05:57 PM by chaumetteg
Mar 14, 2011 05:36 PM|chaumetteg|LINK
I am currently using lo4net for logging in my current application. I know that log4net can be configured to send email notification when there are exceptions based on warning levels. But, is it possible to call it directly? I have a module that parses a
url/html page. I only want to send an email notification when the url is invalid or can't be parse? Is that possible? I have been hesitent to write my own custom email wrapper if I can utilize/reuse log4net in that way.
HtmlWeb web = new HtmlWeb();
logger.Info("DownloadData Thomas: Parsing the url to get xml files..");
HtmlDocument doc = web.Load(thomasUrl);
catch (Exception ex)
logger.Error(" The url could not be parse, the following errors occurred:- ", ex);
// send email here, just an example...not real
Mar 15, 2011 07:32 AM|shridhar.wakhare|LINK
Please see this http://www.dotnetspider.com/resources/20210-Send-Exceptions-or-Error-Email-using-Log-Net.aspx
Mar 22, 2011 05:57 PM|chaumetteg|LINK
I want to avoid getting emails for every exception caught.. is it possible to get an email after the applikcation runs and with compile a list errord? Maybe attached the errors to the email?