Share via


SPDiagnosticsService.LogsToKeep property

NOTE: This API is now obsolete.

Gets or sets a value that indicates the maximum number of log files to create.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
<ObsoleteAttribute("Please use DaysToKeepLogs property instead.")> _
Public Property LogsToKeep As Integer
    Get
    Set
'Usage
Dim instance As SPDiagnosticsService
Dim value As Integer

value = instance.LogsToKeep

instance.LogsToKeep = value
[ObsoleteAttribute("Please use DaysToKeepLogs property instead.")]
public int LogsToKeep { get; set; }

Property value

Type: System.Int32
A Int32 value from 0 to 1024 that indicates the maximum number of log files. The default value is 96, which includes two days of files at the default for the LogCutInterval property.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The value set is either less than 0 or greater than 1024.

Remarks

When the maximum number of log files has been created and a new log file is needed, the oldest log file is deleted.

See also

Reference

SPDiagnosticsService class

SPDiagnosticsService members

Microsoft.SharePoint.Administration namespace