TraceLogRetentionOption 列舉

定義

指定用於 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
繼承
TraceLogRetentionOption

欄位

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 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 4

一個檔案,其檔案大小上限由 MaximumFileSize 屬性決定。One file with a maximum file size that is determined by the MaximumFileSize property.

SingleFileUnboundedSize 2

一個沒有檔案大小限制的檔案。One file with no maximum file size restriction.

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 maximumFileSize MaximumNumberOfFiles EventSchemaTraceListener 設定檔maximumNumberOfFiles中的和自訂屬性, 或在此函式中使用或參數, 來設定和屬性。 maximumFileSizeYou 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. 如果配置maximumFileSizemaximumNumberOfFiles中的或屬性指定超出範圍的值, 則屬性會設定為其預設值。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函式ArgumentOutOfRangeException時, 如果您在或參數中指定超出範圍的值, 則會擲回。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" 表示不會檢查相關聯的屬性是否有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/AN/A -1-1 N/AN/A 11
LimitedSequentialFilesLimitedSequentialFiles >0>0 4 kB4 kB N/AN/A 11
SingleFileBoundedSizeSingleFileBoundedSize >0>0 4 kB4 kB N/AN/A -1-1
SingleFileUnboundedSizeSingleFileUnboundedSize >0>0 4 kB4 kB >0>0 11
UnlimitedSequentialFilesUnlimitedSequentialFiles >0>0 4 kB4 kB >1>1 22

適用於