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 these log files to a different drive.
How to change Diagnostic Logging 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
- Scroll down and set location for diagnostic log files. E.g. Set the log location to "D:\SPLogs\ULS"
- Click on "Ok" button to save your changes.
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.
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
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.