Today is the 2nd of January, and prime time to look at New Year’s Resolutions, or as I like to think of them, a list of things I’ll do for two, maybe three days tops, then forget all about for 363 (or in this case, 364) days. Losing weight is one of the more common ones. Since we all know none of us is actually going to stick with that (I type as I eat some Christmas fudge) I propose we do some other shrinking, reducing the space SharePoint takes on the C drive of your server. For production SharePoint 2010 servers, the C drive should be at least 80 GB, and this blog post doesn’t change that. However, we shouldn’t waste it. When I do SharePoint 2010 installs I always recommend to my customers that they have a secondary drive. That drive serves a few purposes, and one of them is to serve as a place to store stuff you can move off of your C drive. SharePoint’s logs are a great candidate for that. A couple of years ago I blogged how to do this for SharePoint 2007. Today’s post is how to do it for SharePoint 2010.
There are two sets of logs you want to move, the diagnostic logs and the usage logs. An important note is that every machine in the farm must have the same paths for this to work. If one doesn’t have a D drive or something SharePoint will freak out.
Here are the steps:
Central Admin > Monitoring > Configure Diagnostic Logging (/_admin/metrics.aspx). The setting is the “Trace Log” path at the bottom. I strongly recommend only changing the drive letter. Leave the path alone. It’ll make it easier for you to find things later on. You can also use PowerShell to change this. The cmdlet is Set-SPDiagnosticConfig and the parameter is –LogLocation.
Set-SPDiagnosticConfig -LogLocation "E:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS”
Central Admin > Monitoring > Configure web analytics and health data collection (/_admin/LogUsage.aspx). The setting is the “Log file location” setting. Set it to the same path you did the Trace Log above. Again, don’t get fancy and put it at something like “D:\SharePoint\Stuff\Things\LogsAreHiddenHere” The PowerShell cmdlet to alter this is Set-SPUsageService and the parameter is –UsageLogLocation.
Set-SPUsageService -UsageLogLocation "E:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\"
How it looks:
Your disk savings won’t be crazy big, but every little bit counts. By way of comparison the Logs folder on this web server is taking up 3 GB:
The Usage logs get removed once they’re parsed and the Trace logs in that directory go back to 12/19/2011. Your server will certainly have more traffic than mine does, so your logs will probably be larger.
Now, back to that fudge. It’s not going to eat itself, after all.