2010
//Start logging
Set-SPLogLevel -TraceSeverity VerboseEx -EventSeverity Verbose
//Stop logging
Clear-SPLogLevel
2007
//Start logging
stsadm -o setlogginglevel -tracelevel verbose -windowslogginglevel warning
//Stop logging
stsadm -o setlogginglevel -default