kwizcom banner advertisement

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 can affect server performance. Also can quickly fill the system disk which could potentially bringing 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 log files, 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 "Configure usage and health data collection" link under "Reporting Group" of Monitoring section in SharePoint 2013 to change usage and health data collection log files location. 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
Change Log Files Location for ULS, Usage and Health Data Collection Change Log Files Location for ULS, Usage and Health Data Collection Reviewed by Salaudeen Rajack on 6:11 PM Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.