Friday, April 10, 2015

Change Log Files Location for Diagnostic (ULS/Trace) Log, 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 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 groupchange sharepoint 2013 diagnostic 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



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...