SfB CLS Logging: Understanding the CacheFileLocalMaxDiskUsage

Recently, we were asked about the CacheFileLocalMaxDiskUsage setting in CLS Logging.

The issue was when CacheFileLocalMaxDiskUsage was configured to 60% the CLS Logging was returning empty log files.

This setting will look at the total disk space used and not specific to used space by CLS log folder.

If we configure it to 60 it means that the CLS Agent will capture logs until 60% of the disk is used (40% free space). After that will start to overwrite the old logs.

In case that the used disk space is above 60% then the CLS Agent won’t start logging.

We can free some space on the disk or change the value to 80% (default).

Another option is to change the folder to another disk drive, but please note that drive needs to exist in all Skype for Business Servers.

By default the CLS Agent will use %TEMP%\Tracing folder, this is the Network Service temp folder, which is located in:

C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\Tracing

A quick way to check the used disk space is using PowerShell:

Using WMI:

Get-WmiObject -Class win32_Logicaldisk | ?{$_.DriveType -eq 3} | Format-Table -Property DeviceID, @{Name='Used';Expression={"{0:P0}" -f (1-($_.FreeSpace/$_.Size))}}

Using Get-PSDrive:

Get-PSDrive -PSProvider FileSystem | Format-Table -Property Name, @{Name = 'Used';Expression = {"{0:P}" -f ($_.Used/($_.Used+$_.Free))}}

Thanks to the Scripting Guy for the formatting numbers post:

Use PowerShell and Conditional Formatting to Format Numbers | Scripting Blog (microsoft.com)