Diagnostic Logging, Part II
Diagnostic Logging Part II
Overview of how the WSS_Logging database works
So let’s consider the Unified Logging System in SharePoint 2010. All trace logs, event logs, and usage logs get thrown into SQL. This is really awesome. Not only do we have a central place to hunt down errors, but we can report on it! On each local server, we can use the PowerShell commands to scan thru the logs. I’ll talk about that more in Part III. However, the real power isn’t in PowerShell. PowerShell cannot (well, does not) scan other servers in your farm. It doesn’t access the SQL data, either. It does read the logs on the local server.
But imagine if you have a user who gets an error and is provided a correlation token. What will you do with that? Will you run a PS command on each server in your farm until you strike gold? Well, you would have to if you don’t have ULS configured. It won’t be long and you’ll be sure to have it turned on. Once it’s on, you can have a custom ASPX page or even a WPF application go get you some data!
First, stroll on over to your Central Admin web app. Click on configure usage and health data collection. The key is collection. I’m going to turn on everything and configure my schedules.
Now I pop open one of my favorite tools, SQL Management Studio. With it, I go into my DB and take a look at the tables and views.
Notice all the partitions for ExportUsage. Well, there are also partitions for all other tables, too. I just didn’t get a screen grab of them. It appears there are 31 partitions for each table. Just a hunch here: 1 for each day?!
And now take a look at the views.
Let’s right click one and select design. Don’t worry about the error. It’s just telling you as you ‘design’ this query, it won’t be graphic.
Not surprisingly, it’s a UNION ALL of each partition.
But wait!! Where did that ULSTraceLog view come from.
Here are the views again:
I actually had to go back into Central Admin and turn on Web Analytics. Oddly enough, WA is what collects the trace logs.