views:

554

answers:

2

Hi, I have a scenario where I have WSS 3.0 only on a server and I would like to be able to log to the ULS log. In most cases, I have MOSS 2007 installed on the same server and can use the class/method Microsoft.Office.Server.Diagnostics.PortalLog.LogString but that is not an option in this case.

Have anyone else been able to successfully log to the ULS log on a WSS-only server? If not, do you use a logging component instead like log4net etc or how do you log? Logging to the ULS log would be strongly preferred.

TIA, Magnus

+2  A: 

Microsoft has documented it with this example on MSDN

Lars Fastrup
A: 

I use log4net with the ULS LogAppender fromCodeplex: http://splog4net.codeplex.com/

The details on that are here: http://geekswithblogs.net/dotnetrodent/archive/2008/09/11/125079.aspx

And the log4net is here: http://logging.apache.org/log4net/index.html

I find this to be the best solution simply because where and how I log is something that changes from client to client and log4net allows me to re-configure this really easily.