Expand Minimize

TraceLogRetentionOption Enumeration

Specifies the file structure that will be used for the EventSchemaTraceListener log.

Namespace:  System.Diagnostics
Assembly:  System.Core (in System.Core.dll)

public enum TraceLogRetentionOption

Member nameDescription
LimitedCircularFilesA finite number of sequential files, each with a maximum file size. When the MaximumFileSize property value is reached, writing starts in a new file with an incremented integer suffix. When the MaximumNumberOfFiles property value is reached, the first file is cleared and overwritten. Files are then incrementally overwritten in a circular manner.
LimitedSequentialFilesA finite number of sequential files, each with a maximum file size. When the MaximumFileSize property value is reached, writing starts in a new file with an incremented integer suffix.
SingleFileBoundedSizeOne file with a maximum file size that is determined by the MaximumFileSize property.
SingleFileUnboundedSizeOne file with no maximum file size restriction.
UnlimitedSequentialFilesAn unlimited number of sequential files, each with a maximum file size that is determined by the MaximumFileSize property. There is no logical bound to the number or size of the files, but it is limited by the physical constraints imposed by the computer.

The TraceLogRetentionOption enumeration is used to specify the value of the TraceLogRetentionOption property in the EventSchemaTraceListener class. That property setting determines the possible and default values for the EventSchemaTraceListener.MaximumFileSize and EventSchemaTraceListener.MaximumNumberOfFiles properties.

You can set the MaximumFileSize and MaximumNumberOfFiles properties through the maximumFileSize and maximumNumberOfFiles custom attributes in the configuration file or by using the maximumFileSize or maximumNumberOfFiles parameters in the EventSchemaTraceListener constructor. If the maximumFileSize or maximumNumberOfFiles attributes in the configuration file specify an out-of-range value, the properties are set to their default values. If you specify an out-of-range value in the maximumFileSize or maximumNumberOfFiles parameter when you call the EventSchemaTraceListener constructor, an ArgumentOutOfRangeException is thrown.

The following table shows the possible and default values for file size and file count that are associated with each trace log retention option. "N/A" indicates that the associated property is not checked for that TraceLogRetentionOption value.

TraceLogRetentionOption

Maximum file size

Default file size

Maximum number of files

Default number of files

LimitedCircularFiles

N/A

-1

N/A

1

LimitedSequentialFiles

>0

4 kB

N/A

1

SingleFileBoundedSize

>0

4 kB

N/A

-1

SingleFileUnboundedSize

>0

4 kB

>0

1

UnlimitedSequentialFiles

>0

4 kB

>1

2

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft