SPWebApplication.EventLogRetentionPeriod property
SharePoint 2013
Gets or sets the amount of time to preserve event logs.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Property value
Type: System.TimeSpanTimeSpan
The amount of time to preserve event logs, ignoring hours, minutes, and seconds.
| Exception | Condition |
|---|---|
| SecurityException | The current user is not a farm administrator. |