TraceLogRetentionOption Enumeration
TOC
Collapse the table of content
Expand the table of content

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
LimitedCircularFiles

A 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.

LimitedSequentialFiles

A 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.

SingleFileBoundedSize

One file with a maximum file size that is determined by the MaximumFileSize property.

SingleFileUnboundedSize

One file with no maximum file size restriction.

UnlimitedSequentialFiles

An 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
Available since 3.5
Return to top
Show:
© 2016 Microsoft