Something that I don’t always remember – you can use the SPMonitoredScope class to monitor your SharePoint code as it executes. The results then get sent to the Developer Dashboard and ULS logs. There’s a decent description of it on MSDN.
using (new SPMonitoredScope("My Monitored Scope"))
// Do Stuff...
Sometimes, you want to know if your assembly is a Debug or Release build – like if you’re outputting assembly information for diagnostic purposes. But how do you know? Continue reading
I had a problem that one of our development machines had been configured in a ‘Least Privileges’ configuration – and it was a bit too least. The content app pool could not write to the logs. OWSTimer and WebAnalytics both could, but there was nothing from W3WP for that web app.
Just a reminder to myself…
Well, the solution was to add the app pool account to the ‘Performance Log Users’ group in AD. You find it under BUILTIN. Reset ISS. Voila!
With SharePoint 2010, Microsoft gave us a better framework for logging that SharePoint 2007, which relied on writing most of your own. Sadly, though, the SPDiagnosticsServiceBase does lack in a couple of areas. Consequently, I’ve ended up writing my own Diagnostics service to try and address those issues. I am far from the only one (See the references below), but I’d like to present what I’ve written, not least ‘cos I’ve been meaning to blog about it for about 8 months.
First, though, let’s look at the limitations of the SPDiagnosticsServiceBase. Continue reading
I’ve been looking at how to use the SPCriticalTraceCounter class for outputting messages in the Developer Dashboard. I came across a good post about how to do this by Frode Aarebrot, but it left me puzzled – what was the traceLevel integer about? Why wasn’t it an enumeration – like the Microsoft.SharePoint.Administration.TraceSeverity enum? Why those magic values? What happened if I used a wrong value?