17.1.12

Writing to the SharePoint ULS Logs

try{
  ...
} catch (Exception ex) {
  SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("MSDN", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace);
}

 

Product column is Unknown. This is the default behavior of the SPDiagnosticsService class

Unfortunately, interacting with a custom SPDiagnosticsService is available only in fully trusted farm solutions and not within sandboxed solutions.

To write to the ULS logs by using theSPDiagnosticsService class from the sandbox, developers can create a full trust proxy that the sandboxed solutions can call into

No comments:

Post a Comment