Change Log Files Location for ULS, Usage and Health Data Collection

No doubts, diagnostic logs and “Usage and health data” logs are extremely helpful. However, it could cause performance issues and slow down SharePoint if not managed properly. These logs can use large amounts of drive space and affect server performance. Also, it can quickly fill the system disk, which could potentially bring the entire system down!

So, it is recommended to change the location of these log files to a different drive.

How to change ULS Log location in SharePoint 2013?

By default, logging is configured to write logs to the drive and partition where SharePoint 2013 is installed at “C:\Program Files\Common Files\Microsoft shared\Web Server Extensions\15\LOGS”. Changing the SharePoint 2013 log settings can be done using PowerShell or Central Admin.

  • Go to Share 2013 Central Administration >> Monitoring 
  • Click “Configure diagnostic logging” Under Reporting group
    change sharepoint 2013 uls log file location
  • Scroll down and set location for diagnostic log files. E.g. Set the log location to “D:\SPLogs\ULS”
    set log file location for ULS/Trace Logs in sharepoint
  • Click on “Ok” button to save your changes.

Additionally, you can set other related options, such as the number of days to keep the maximum disk space for log files.

Set Diagnostic log file location using PowerShell:

Use the following command to change the diagnostic log file location.

Set-SPDiagnosticConfig -LogLocation "D:\SPLogs\ULS"  

You can combine it with other settings: 

Set-SPDiagnosticConfig -LogLocation "D:\SPLogs\ULS" -DaysToKeepLogs 90 -LogMaxDiskSpaceUsageEnabled -LogDiskSpaceUsageGB 50

Set Usage and Health Data Collection log location:

Click on the “Configure usage and health data collection” link under the “Reporting Group” of the Monitoring section in SharePoint 2013 to change the location of usage and health data collection log files. E.g., Set the log location to D:\SPLogs\Health.
sharepoint 2013 usage and health logging

Set SharePoint 2013 usage and health log file location using PowerShell

Use this PowerShell command to change the Usage and usage and health data collection log files location:

Set-SPUsageService -UsageLogLocation "D:\SPLogs\UsageLogs"

Related Post: Configure Diagnostic Logging in SharePoint

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *