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 - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

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