Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 24, 2011 05:15 PM by gratisaccount
Member
77 Points
42 Posts
Nov 24, 2011 05:15 PM|LINK
Hi All,
Recently I've started using Enterprise Library Logging Block With Exception block to log errors into database.
For this purpose, I was using the Logging provide the 'Enterprise Library'.
But now due to some reasons, I've to use the Log table with limited columns.
Can you please suggest, How can I do that?
As of now I'm using the following code to write error in database:
public static void LogError(System.Exception ex, string errFrom) { try { LogEntry le = new LogEntry(); le.Title = errFrom; le.Message = "Message: " + ex.Message + System.Environment.NewLine + "Inner Exception: " + ex.InnerException + System.Environment.NewLine + "Stack Trace: " + ex.StackTrace.ToString(); le.Severity = System.Diagnostics.TraceEventType.Error; Logger.Write(le); } catch (Exception exc) { ExceptionPolicy.HandleException(exc, "MyException Policy"); System.Web.HttpContext.Current.Response.Redirect("ErrHandler.aspx", true); } }
Application I'm working on is made in asp.net 2.0 With Enterprize Library 3.1
Any help is appreciated.
block
gratisaccoun...
Member
77 Points
42 Posts
How to use customize database with Enterprise Library Logging Block
Nov 24, 2011 05:15 PM|LINK
Hi All,
Recently I've started using Enterprise Library Logging Block With Exception block to log errors into database.
For this purpose, I was using the Logging provide the 'Enterprise Library'.
But now due to some reasons, I've to use the Log table with limited columns.
Can you please suggest, How can I do that?
As of now I'm using the following code to write error in database:
block