TraceLogRetentionOption TraceLogRetentionOption TraceLogRetentionOption TraceLogRetentionOption Enum

定义

指定将用于 EventSchemaTraceListener 日志的文件结构。Specifies the file structure that will be used for the EventSchemaTraceListener log.

public enum class TraceLogRetentionOption
public enum TraceLogRetentionOption
type TraceLogRetentionOption = 
Public Enum TraceLogRetentionOption
继承
TraceLogRetentionOptionTraceLogRetentionOptionTraceLogRetentionOptionTraceLogRetentionOption

字段

LimitedCircularFiles LimitedCircularFiles LimitedCircularFiles LimitedCircularFiles 1

数量有限的顺序文件,每个文件均具有最大文件大小。A finite number of sequential files, each with a maximum file size. 当达到 MaximumFileSize 属性值时,即开始在带有递增整数后缀的新文件中写入。When the MaximumFileSize property value is reached, writing starts in a new file with an incremented integer suffix. 当达到 MaximumNumberOfFiles 属性值时,会清除和覆盖第一个文件。When the MaximumNumberOfFiles property value is reached, the first file is cleared and overwritten. 然后,会以循环方式逐渐覆盖这些文件。Files are then incrementally overwritten in a circular manner.

LimitedSequentialFiles LimitedSequentialFiles LimitedSequentialFiles LimitedSequentialFiles 3

数量有限的顺序文件,每个文件均具有最大文件大小。A finite number of sequential files, each with a maximum file size. 当达到 MaximumFileSize 属性值时,即开始在带有递增整数后缀的新文件中写入。When the MaximumFileSize property value is reached, writing starts in a new file with an incremented integer suffix.

SingleFileBoundedSize SingleFileBoundedSize SingleFileBoundedSize SingleFileBoundedSize 4

一个最大文件大小由 MaximumFileSize 属性确定的文件。One file with a maximum file size that is determined by the MaximumFileSize property.

SingleFileUnboundedSize SingleFileUnboundedSize SingleFileUnboundedSize SingleFileUnboundedSize 2

一个没有最大文件大小限制的文件。One file with no maximum file size restriction.

UnlimitedSequentialFiles UnlimitedSequentialFiles UnlimitedSequentialFiles UnlimitedSequentialFiles 0

无限数量的顺序文件,每个文件的最大文件大小由 MaximumFileSize 属性确定。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.

注解

枚举用于指定EventSchemaTraceListener类中的TraceLogRetentionOption属性的值。 TraceLogRetentionOptionThe TraceLogRetentionOption enumeration is used to specify the value of the TraceLogRetentionOption property in the EventSchemaTraceListener class. 该属性设置将确定EventSchemaTraceListener.MaximumFileSizeEventSchemaTraceListener.MaximumNumberOfFiles属性的可能值和默认值。That property setting determines the possible and default values for the EventSchemaTraceListener.MaximumFileSize and EventSchemaTraceListener.MaximumNumberOfFiles properties.

您可以通过配置MaximumFileSize文件MaximumNumberOfFiles中的maximumFileSizemaximumNumberOfFiles自定义特性或使用EventSchemaTraceListener构造函数中的maximumFileSizemaximumNumberOfFiles参数来设置和属性。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. 如果配置maximumFileSize文件maximumNumberOfFiles中的或特性指定了超出范围的值, 则属性将设置为其默认值。If the maximumFileSize or maximumNumberOfFiles attributes in the configuration file specify an out-of-range value, the properties are set to their default values. maximumFileSize如果在maximumNumberOfFiles 调用构造EventSchemaTraceListener函数时在或参数中指定了超出范围的值, 则会引发。ArgumentOutOfRangeExceptionIf 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”表示未为该 TraceLogRetentionOption 值检查关联的属性。"N/A" indicates that the associated property is not checked for that TraceLogRetentionOption value.

TraceLogRetentionOptionTraceLogRetentionOption 最大文件大小Maximum file size 默认文件大小Default file size 最大文件数Maximum number of files 默认文件数Default number of files
LimitedCircularFilesLimitedCircularFiles 不可用N/A -1-1 不可用N/A 11
LimitedSequentialFilesLimitedSequentialFiles >0>0 4 kB4 kB 不可用N/A 11
SingleFileBoundedSizeSingleFileBoundedSize >0>0 4 kB4 kB 不可用N/A -1-1
SingleFileUnboundedSizeSingleFileUnboundedSize >0>0 4 kB4 kB >0>0 11
UnlimitedSequentialFilesUnlimitedSequentialFiles >0>0 4 kB4 kB >1>1 22

适用于