Configure ULS log and Usage and Health log location

by Marco Rietveld 23. oktober 2014 13:30

Diagnostic logging can use large amounts of drive space and writing to the logs can affect drive performance.
Also logging can quickly fill the system disk, potentially bringing the entire system to a crashing halt.
Therefore, it is recommended to configure logging to write to a different drive.

By default, logging is configured to write logs to the drive and partition where SharePoint 2013 is installed.

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS

SharePoint 2013 does not limit the amount of disk space that diagnostic logging can use.
To prevent SharePoint to fill the disk with log files, especially when using verbose-level events, it is recommended to set a maximum disk space usage.
Also a new log file is created every 30 minutes. When the space that is available to the log file is used, the oldest logs are removed and new logging data information is recorded.

Changing the SharePoint 2013 log settings can be done using PowerShell or Central Admin.

Use the following PowerShell commands to change the settings:

Diagnostics log(ULS)

Setting the log location to D:\SPlogs\ULS and set the number of days to keep the log files to 60 with a maximum disk space of 100GB

Use the following command to change the settings:

set-SPDiagnosticConfig -LogLocation D:\SPLogs\ULS -DaysToKeepLogs 60 -LogMaxDiskSpaceUsageEnabled -LogDiskSpaceUsageGB 100

Usage and Health log

Setting the log location to D:\SPLogs\Health and leave other settings default.

Use the following command to change the log location:

set-SPUsageService –UsageLogLocation “D:\splog\Health”

 

ULS Viewer

The ULS Viewer can be used to view the logs using in a user-friendly interface. 
ULS Viewer can filter, sort, highlight and append logs to help locate data that is relevant to an issue.
SharePoint 2013 uses correlation IDs, that are identifiers associated with every request and are displayed with error messages.
By filtering the correlation ID it is possible to identify the request that caused the error.

ULS Viewer download
http://www.microsoft.com/en-us/download/details.aspx?id=44020

Tags: | |

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2018 SharePoint Geek