There are several methods of logging exceptions in SharePoint such as in SharePoint Logs, Event Viewer, etc. In this post, I would like to discuss logging SharePoint exceptions in Logs folder of SharePoint 12 hive programmatically.
Add Microsoft.Office.Server dll as a reference to your project
Add following line in using section
using Microsoft.Office.Server.Diagnostics;
PortalLog.LogString("Source:", “YourApplicationName”, “TypeofError”, “ActualExceptionMessageGoesHere”);
regards,
Sudhakar Bulli
No comments:
Post a Comment