Wednesday, February 29, 2012

Logging errors/exceptions of sharepoint into Logs

NameSpace: using Microsoft.SharePoint.Administration;

SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("My Custom category"TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message + ex.StackTrace, null);

No comments: