Home > Blog > Unrestricted SharePoint Logs: The Silent Killer

I’ve seen an alarming number of incidents where clients are having issues with server drive space filling up.

And I don’t mean a, “oh, this drive is getting full, we should add more space…” kind of issue.

I mean a, “Hey, why is SharePoint down?!”, kind of issue!

Your C: drive unexpectedly running out of space is no joke!

You might be thinking, “Gee, thanks. This is 101 stuff, isn’t it?” And I certainly agree, which is why I’ve found this so baffling.

I think it might be compounded because it seems so obvious that it inevitably leads to finger-pointing.

That’s somebody else’s job, isn’t it? Well, this may be true, but if you’re in a situation where you’re trying to figure out how to purge those darn logs, I hope this post will save you valuable time.

I’ve found a few common culprits and some remedies I think you’ll find useful.

Outside of the obvious removal of large, unused files and making sure your SharePoint ULS logs are being properly managed (via Central Administration), you may still find a gradual creep of precious free-space disappearing into the ether.

There are 2 Logs that notoriously eat up space:

  1. IIS Logs – Usually, “C:\inetpub\logs\LogFiles”
  2. Windows Fabric Trace Logs – Usually, “C:\ProgramData\Windows Fabric\Fabric\log\Traces\*”

Neither of these are configured Out-of-Box to manage log growth… wait, what?! Why?!

To give you something to do on your Saturday when your server decides to sling it into the fan, I suppose.

To determine where your space is being chewed up, you can use a free tool like WinDirStat to locate your particular space hogs.

If you find the above logs to be your bane, keep reading…

For IIS, Jim van de Erve wrote a great Microsoft Doc article about Managing IIS Log File Storage, in which he uses a simple .vbs script which you can set on a Scheduled Task to clear out IIS Logs that are older than x days. Here is the script:

 

sLogFolder = “c:\inetpub\logs\LogFiles”

iMaxAge = 30 ‘in days

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

set colFolder = objFSO.GetFolder(sLogFolder)

For Each colSubfolder in colFolder.SubFolders

Set objFolder = objFSO.GetFolder(colSubfolder.Path)

Set colFiles = objFolder.Files

For Each objFile in colFiles

iFileAge = now-objFile.DateCreated

if iFileAge > (iMaxAge+1) then

objFSO.deletefile objFile, True

end if

Next

Next

You can copy this into Notepad and save it as a .vbs file; then, run it as you normally would “As Administrator” through PowerShell.

NOTE: You’ll want to verify the path in Line 1 is accurate and you’ll also want to adjust the number of days in line 2 to whatever is appropriate for your server(s).

For the Fabric Trace Logs , you can just delete the old trace files, but eventually they will fill back up. I’d recommend the following setting be applied to Performance Monitor : Under the “User Defined” Collector Sets, highlight the “Fabric Traces” Data Collector, but then ‘right-click’ the file name in the right window and select, “Properties”.

Under the File tab, select “Circular”. Then you’ll need to stop and re-start the collector.

Now the new file will just overwrite itself with fresh data once it reaches the max size, instead of continuing to create new files over and over.

Prefer to get some help?

Let IncWorx carry the load and set up log retention on all your SharePoint servers with our low-cost, Microsoft Pay-As-You-Go Consulting.

We also specialize in full Support for all your SharePoint, Office 365, and cloud needs!

0 Comments

[wpforms id="1422"]
<div class="wpforms-container wpforms-container-full" id="wpforms-1422"><form id="wpforms-form-1422" class="wpforms-validate wpforms-form" data-formid="1422" method="post" enctype="multipart/form-data" action="/blog/unrestricted-sharepoint-logs-the-silent-killer" data-token="5004881076b4dd02782711e0acad13b3"><noscript class="wpforms-error-noscript">Please enable JavaScript in your browser to complete this form.</noscript><div class="wpforms-field-container"><div id="wpforms-1422-field_0-container" class="wpforms-field wpforms-field-name" data-field-id="0"><label class="wpforms-field-label" for="wpforms-1422-field_0">Name <span class="wpforms-required-label">*</span></label><input type="text" id="wpforms-1422-field_0" class="wpforms-field-large wpforms-field-required" name="wpforms[fields][0]" required></div><div id="wpforms-1422-field_1-container" class="wpforms-field wpforms-field-email" data-field-id="1"><label class="wpforms-field-label" for="wpforms-1422-field_1">Email <span class="wpforms-required-label">*</span></label><input type="email" id="wpforms-1422-field_1" class="wpforms-field-large wpforms-field-required" name="wpforms[fields][1]" required></div><div id="wpforms-1422-field_3-container" class="wpforms-field wpforms-field-phone" data-field-id="3"><label class="wpforms-field-label" for="wpforms-1422-field_3">Phone <span class="wpforms-required-label">*</span></label><input type="tel" id="wpforms-1422-field_3" class="wpforms-field-large wpforms-field-required wpforms-masked-input" data-inputmask="&#039;mask&#039;: &#039;(999) 999-9999&#039;" data-rule-us-phone-field="true" name="wpforms[fields][3]" required></div><div id="wpforms-1422-field_2-container" class="wpforms-field wpforms-field-textarea" data-field-id="2"><label class="wpforms-field-label" for="wpforms-1422-field_2">How can we help you? <span class="wpforms-required-label">*</span></label><textarea id="wpforms-1422-field_2" class="wpforms-field-small wpforms-field-required" name="wpforms[fields][2]" required></textarea></div><div id="wpforms-1422-field_15-container" class="wpforms-field wpforms-field-html" data-field-id="15"><div id="wpforms-1422-field_15"><p style="padding-top: 10px; padding-bottom: 10px; font-family: 'Open Sans', sans-serif; font-size: 10px; color: #333333;">By clicking the button below, you are agreeing to our <span style="text-decoration: underline;"><span style="color: #000000;"><a style="color: #000000; text-decoration: underline;" href="https://www.incworx.com/privacy-policy">Privacy Policy</a></span></span>.</p></div></div><div id="wpforms-1422-field_7-container" class="wpforms-field wpforms-field-hidden" data-field-id="7"><input type="hidden" id="wpforms-1422-field_7" name="wpforms[fields][7]" value="Unrestricted SharePoint Logs: The Silent Killer"></div><div id="wpforms-1422-field_9-container" class="wpforms-field wpforms-field-hidden" data-field-id="9"><input type="hidden" id="wpforms-1422-field_9" name="wpforms[fields][9]" value="75.101.220.230"></div><div id="wpforms-1422-field_10-container" class="wpforms-field wpforms-field-hidden" data-field-id="10"><input type="hidden" id="wpforms-1422-field_10" name="wpforms[fields][10]"></div></div><div class="wpforms-field wpforms-field-hp"><label for="wpforms-1422-field-hp" class="wpforms-field-label">Website</label><input type="text" name="wpforms[hp]" id="wpforms-1422-field-hp" class="wpforms-field-medium"></div><div class="wpforms-submit-container" ><input type="hidden" name="wpforms[id]" value="1422"><input type="hidden" name="wpforms[author]" value="2"><input type="hidden" name="wpforms[post_id]" value="631"><button type="submit" name="wpforms[submit]" class="wpforms-submit " id="wpforms-submit-1422" value="wpforms-submit" aria-live="assertive" data-alt-text="Sending..." data-submit-text="Submit">Submit</button></div></form></div> <!-- .wpforms-container -->