Tuesday, February 5, 2013

Log errors to event log


try{
      
//Your method code here
}
catch (Exception ex)
{
SPDiagnosticsService.Local.WriteEvent(0, new SPDiagnosticsCategory("My Error Category", TraceSeverity.Unexpected,
EventSeverity.ErrorCritical), EventSeverity.ErrorCritical, ex.Message, ex.StackTrace);
}

No comments:

SSL Error - The connection for this site is not secure

 After cloning a git repo of dot net framework website and trying to run it all I could see was this error Turns out the fix was to simply e...