EventLogConfiguration 類別

定義

包含事件記錄檔的靜態資訊和組態設定。Contains static information and configuration settings for an event log. 許多組態設定都是由建立記錄檔的事件提供者所定義。Many of the configurations settings were defined by the event provider that created the log.

public ref class EventLogConfiguration : IDisposable
public class EventLogConfiguration : IDisposable
type EventLogConfiguration = class
    interface IDisposable
Public Class EventLogConfiguration
Implements IDisposable
繼承
EventLogConfiguration
實作

範例

如需使用此類別的範例程式碼,請參閱 [How to:設定和讀取事件記錄檔屬性 @ no__t-0。For example code using this class, see How to: Configure and Read Event Log Properties.

備註

如果已變更此物件的屬性,請呼叫 SaveChanges 方法來儲存變更。If a property is changed for this object, call the SaveChanges method to save the changes.

建構函式

EventLogConfiguration(String)

藉由指定要取得資訊和組態設定的本機事件記錄檔,初始化新的 EventLogConfiguration 物件。Initializes a new EventLogConfiguration object by specifying the local event log for which to get information and configuration settings.

EventLogConfiguration(String, EventLogSession)

藉由指定要取得資訊和組態設定的記錄檔名稱,初始化新的 EventLogConfiguration 物件。Initializes a new EventLogConfiguration object by specifying the name of the log for which to get information and configuration settings. 根據指定的事件記錄工作階段,記錄檔可以位於本機電腦或遠端電腦。The log can be on the local computer or a remote computer, based on the event log session specified.

屬性

IsClassicLog

取得值,這個值表示事件記錄檔是否為傳統事件記錄檔。Gets a value that indicates whether the event log is a classic event log. 傳統事件記錄檔的事件是在 .mc 檔案中定義,而非事件提供者所使用的資訊清單 (.xml 檔案)。A classic event log is one that has its events defined in an .mc file instead of a manifest (.xml file) used by the event provider.

IsEnabled

取得或設定值,這個值表示事件記錄檔已啟用還是停用。Gets or sets a value that indicates whether the event log is enabled or disabled. 已啟用的記錄檔可以記錄事件,而已停用的記錄檔則無法記錄事件。An enabled log is one in which events can be logged, and a disabled log is one in which events cannot be logged.

LogFilePath

取得或設定存放事件之記錄檔的目錄路徑。Gets or sets the file directory path to the location of the file where the events are stored for the log.

LogIsolation

取得 EventLogIsolation 值,這個值表示事件記錄檔是應用程式、系統,還是自訂事件記錄檔。Gets an EventLogIsolation value that specifies whether the event log is an application, system, or custom event log.

LogMode

取得或設定 EventLogMode 值,這個值可決定事件記錄檔已滿時如何處理事件。Gets or sets an EventLogMode value that determines how events are handled when the event log becomes full.

LogName

取得事件記錄檔的名稱。Gets the name of the event log.

LogType

取得 EventLogType 值,這個值可決定事件記錄檔的型別。Gets an EventLogType value that determines the type of the event log.

MaximumSizeInBytes

取得或設定允許的事件記錄檔大小上限 (以位元組為單位)。Gets or sets the maximum size, in bytes, that the event log file is allowed to be. 當檔案達到這個大小上限時,就表示檔案已滿。When the file reaches this maximum size, it is considered full.

OwningProviderName

取得建立這個事件記錄檔之事件提供者的名稱。Gets the name of the event provider that created this event log.

ProviderBufferSize

取得緩衝區大小,事件提供者會使用這個緩衝區將事件發行至記錄檔。Gets the size of the buffer that the event provider uses for publishing events to the log.

ProviderControlGuid

如果事件記錄檔是偵錯記錄檔,則取得此事件記錄檔的控制項全域唯一識別項 (GUID)。Gets the control globally unique identifier (GUID) for the event log if the log is a debug log. 如果此記錄檔不是偵錯記錄檔,則這個值會是 nullIf this log is not a debug log, this value is null.

ProviderKeywords

取得或設定事件提供者所使用的關鍵字遮罩。Gets or sets the keyword mask used by the event provider.

ProviderLatency

取得事件提供者將事件發行至記錄檔時,所使用的最大延遲時間。Gets the maximum latency time used by the event provider when publishing events to the log.

ProviderLevel

取得或設定事件記錄檔中允許記錄的最大事件等級 (會定義事件的嚴重性)。Gets or sets the maximum event level (which defines the severity of the event) that is allowed to be logged in the event log. 這個值由事件提供者定義。This value is defined by the event provider.

ProviderMaximumNumberOfBuffers

取得事件提供者將事件發行至事件記錄檔時,所使用的最大緩衝區數目。Gets the maximum number of buffers used by the event provider to publish events to the event log.

ProviderMinimumNumberOfBuffers

取得事件提供者將事件發行至事件記錄檔時,所使用的最小緩衝區數目。Gets the minimum number of buffers used by the event provider to publish events to the event log.

ProviderNames

取得可列舉的集合,包含可將事件發行至這個事件記錄檔的所有事件提供者名稱。Gets an enumerable collection of the names of all the event providers that can publish events to this event log.

SecurityDescriptor

取得或設定事件記錄檔的安全性描述元 (Security Descriptor)。Gets or sets the security descriptor of the event log. 安全性描述元會定義可讀取和寫入事件記錄檔的使用者和使用者群組。The security descriptor defines the users and groups of users that can read and write to the event log.

方法

Dispose()

釋放這個物件所使用的所有資源。Releases all the resources used by this object.

Dispose(Boolean)

釋放這個物件所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by this object, and optionally releases the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
SaveChanges()

儲存組態設定。Saves the configuration settings that.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱