SPDiagnosticsService.LogsToKeep Property

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

Public Property LogsToKeep As Integer
    Get
    Set

Dim instance As SPDiagnosticsService
Dim value As Integer

value = instance.LogsToKeep

instance.LogsToKeep = value
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