如何使用CSOM将异常写入ULS日志?

时间:2016-04-25 12:55:18

标签: sharepoint-2013 uls

有没有办法将异常记录到sharepoint 2013内部部署版本的ULS日志中?它应该只使用csom来完成..

1 个答案:

答案 0 :(得分:0)

利用diagnostics.asmx网络服务 -

SharePointDiagnostics SharePointDiagnosticsObject = new SharePointDiagnostics();
SharePointDiagnosticsObject.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
string Response = SharePointDiagnosticsObject.SendClientScriptErrorReport(message, file, line, client, stack, team, originalFile);

有关diagnostics.asmx用法的更多详细信息,请参阅以下链接 -

https://vivekkumar11432.wordpress.com/2016/09/23/how-to-do-logging-in-uls-from-csom-in-c/