Log to SharePoint log file.

by Victor 15. June 2010 22:24

1. Create a project (It seems .net 4 doesn't work well with SharePoint 2007)
2. Add the reference to Microsoft.Office.Server.dll. (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI)
3. The log code looks like this.

try
{
  throw new Exception("This is a test");
}
catch (Exception ex)
{
  Microsoft.Office.Server.Diagnostics.PortalLog.LogString(ex.Message, null);
}

Done

Tags: ,

Sharepoint

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Month List