Tuesday, February 15, 2011

Some commands related to logging (SharePoint 2007)

When you're investigating logs, it is often useful to force SharePoint to begin logging to a new file after you making a change to logging levels. You can accomplish this by restarting the sptrace service:
net stop sptrace && net start sptrace
This is a command that no SharePoint administrator should be without. Inevitably, you'll need to ratchet up the logging levels to help resolve an issue. Once you're done examining the logs, instead of returning individual logging categories back to the default, use this command to return ALL categories to default.
stsadm -o setlogginglevel -default