More on adding to ULS logs

Add this to a class, or anywhere accessible, and notes can be added to ULS logs to help with coding.

public static void AddNoteToULS(string thetitle, string themessage)
SPDiagnosticsService diagSvc = SPDiagnosticsService.Local;
diagSvc.WriteTrace(0, new SPDiagnosticsCategory(thetitle, TraceSeverity.Monitorable, EventSeverity.Error), TraceSeverity.Monitorable,
“Writing to the ULS log: {0}”, new object[] { themessage });

Comments are closed.