Hi,
I finished a SharePoint 2010 project, but some errors are logged at Windows Event Viewer. Howover, I want the error to be logged at ULS SharePoint log.
If a use the bellow code, the error shows only at ULS SharePoint log and doesn't show at Windows Event Viewer, right? What do you think about?
try
{
var i = 0;
var a = 2 / i;
}
catch (Exception ex)
{
SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("MyCategory", TraceSeverity.Unexpected, EventSeverity.Error),TraceSeverity.Unexpected, ex.Message, ex.StackTrace);
}Thanks
Everton