Using your own logfiles in SharePoint 2007

By | 2007-05-04

After reading the MSDN on Trace Logs in MOSS/WSS, I wrote my own little class to Log messages and exceptions.

The trick is, that this Logging class will log to the same folder as MOSS 2007 will log to.


You can use this this code to easily write to your own Moss Logs:

try {
// some code
int i = int.Parse(“1”);
TamTam.SharePoint.Diagnostics.LogMessage(“MyLog”,“Category1”,“Integer i found”);
catch(Exception exc) {

Download source code here Logging.cs (4.73 KB)

Download an assembly with this class here TamTam.SharePoint.Diagnostics.dll (16 KB)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.