How to handle exception using Microsoft enterprise library http://forums.asp.net/t/1521830.aspx/1?How+to+handle+exception+using+Microsoft+enterprise+library+Tue, 09 Feb 2010 06:42:55 -050015218303659786http://forums.asp.net/p/1521830/3659786.aspx/1?How+to+handle+exception+using+Microsoft+enterprise+library+How to handle exception using Microsoft enterprise library <p>How to&nbsp; log the exception or send out an email in website using Microsoft EnterPrise library Exception handling .</p> <p><br> </p> 2010-02-04T06:31:02-05:003660451http://forums.asp.net/p/1521830/3660451.aspx/1?Re+How+to+handle+exception+using+Microsoft+enterprise+libraryRe: How to handle exception using Microsoft enterprise library <p>I Used below method : But unable to&nbsp; send&nbsp; mail..<br> </p> <p>private static EmailTraceListener GetEmailTraceListener(TextFormatter formatter)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Log messages to a log file.<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Use the formatter passed<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // as well as the header and footer<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // specified.<br> <br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EmailTraceListener mailListener =<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new EmailTraceListener(&quot;abc@snlcorporate.com&quot;, &quot;abc@gmail.com&quot;, &quot;Admin&quot;, &quot;&lt;&lt;ApplicationName&gt;&gt;&quot;, &quot;smtp.gmail.com&quot;, xyz, formatter);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return mailListener;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p><br> </p> <p><br> </p> 2010-02-04T12:02:32-05:003665569http://forums.asp.net/p/1521830/3665569.aspx/1?Re+How+to+handle+exception+using+Microsoft+enterprise+libraryRe: How to handle exception using Microsoft enterprise library <p>I am also very new to Logging block. according to my knowledge we can&nbsp;configure all the email settings in app.config/web.config as a Trace Lister. So no need to write&nbsp;any code related to email settings in c#.&nbsp;Once you use Logger.Write(&quot;.....&quot;). your&nbsp;string in write method will be redirected to the Trace listener you&nbsp;configured in&nbsp;.config file. This trace listener could be email, database,&nbsp;windows event&nbsp;log...etc. Unfortunatly I could not get&nbsp;good material in web.&nbsp;I would also wait for reply for someone to get clear picture on how to configure all these things.</p> 2010-02-07T19:09:48-05:003666055http://forums.asp.net/p/1521830/3666055.aspx/1?Re+How+to+handle+exception+using+Microsoft+enterprise+libraryRe: How to handle exception using Microsoft enterprise library <p>for log Entry in database follow&nbsp; below post steps :</p> <p>http://entlib.codeplex.com/Thread/View.aspx?ThreadId=83105</p> <p><br> </p> <p>First of all you must execute the .sql file that will create the Logging database for you. It is available in the &lt;Drive Letter&gt;\EntLib41Src\Blocks\Logging\Src\DatabaseTraceListener\Scripts\<b>LoggingDatabase.sql </b>. Then you can now (1)add a Database trace listener in the LAB. (2) Configure a connection string in your DAAB section which points to the database that was created running the said script. (3) Configure the DatabaseInstance property&nbsp;of the database trace listener and point it to the created connection string in step #2. (4) Add a trace listener reference to the desired category and point its reference to the database trace listener.</p> <p>Source: <b><i>Valiant Dudan</i></b><br> Global Technology and Solutions<br> Avanade, Inc.</p> 2010-02-08T04:53:37-05:003668455http://forums.asp.net/p/1521830/3668455.aspx/1?Re+How+to+handle+exception+using+Microsoft+enterprise+libraryRe: How to handle exception using Microsoft enterprise library <p>Hi Sandeep, His/My question was related to Email sending using Logging Listers.<br> </p> 2010-02-09T06:42:55-05:00