How To Write In Sharepoint Log File 怎麼對自定義的MOSS代碼寫日誌this
Add Microsoft.Office.Server dll in your project, you can find this dll under 「\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\」.日誌
The log files are found under \Common Files\Microsoft Shared\Web Server Extensions\12\Log\. Following line of code is used to write exception in sharepoint default log file.code
Microsoft.Office.Server.Diagnostic.PortalLog.LogString("Exception - {0} - {1} - {2}","User Friendly Message",ex.Message,ex.StackTrace);