EventLog イベント

名前 | 説明 | |
---|---|---|
![]() | Disposed | コンポーネントの Disposed イベントを待機するイベント ハンドラを追加します。 ( Component から継承されます。) |
![]() | EntryWritten | ローカル コンピュータ上のイベント ログにエントリが書き込まれたときに発生します。 |

EventLog クラス
アセンブリ: System (system.dll 内)


EventLog を使用すると、重要なソフトウェア イベントまたはハードウェア イベントについての情報を記録する Windows のイベント ログへのアクセスやカスタマイズが可能になります。EventLog を使用して、既存のログからの読み取り、ログへのエントリの書き込み、イベント ソースの作成や削除、ログ エントリへの応答などを行うことができます。また、イベント ソースの作成時に新しいログを作成することもできます。
![]() |
---|
EventLog オブジェクトを作成し、エントリを書き込んで、信頼性が一部しか確認されていないコードに EventLog オブジェクトを渡すと、セキュリティ上の問題が発生することがあります。信頼性の低いコードには、EventLogEntry オブジェクトや EventLogEntryCollection オブジェクトなどのイベント ログ オブジェクトを渡さないでください。 |
![]() |
---|
NET Framework Version 1.0 および 1.1 では、このクラスは直接の呼び出し元に完全な信頼を要求します。Version 2.0 では、このクラスは EventLogPermission に特定のアクションを要求します。EventLogPermission で信頼性が一部しか確認されていないコードを許可しないようにすることをお勧めします。イベント ログの読み取りと書き込みを行う機能を利用して、別のアプリケーションの名前でイベント ログ メッセージを発行するなどのアクションを実行できます。 |
![]() |
---|
イベント ソースを作成または削除する場合、名前付きミューテックスを使用して基になるコードを同期する必要があります。高度な特権が付与されたアプリケーションが名前付きミューテックスをロックしている場合、イベント ソースを作成または削除しようとすると、ロックが解除されるまでアプリケーションは応答を停止します。この問題を回避するために、信頼関係のないコードには UnmanagedCode アクセス許可を付与しないでください。また、UnmanagedCode アクセス許可を使用すると、他のアクセス許可をバイパスできる可能性もあるため、信頼度の高いコードにだけこのアクセス許可を付与する必要があります。 |
ログを読み取るには、EventLog に Log 名と MachineName (サーバー コンピュータ名) を指定します。ソースが必要なのはログに書き込む場合だけであるため、Source を指定する必要はありません。Entries メンバには、自動的にイベント ログのエントリ リストが設定されます。
![]() |
---|
Log/MachineName のペアを指定してログに接続している場合は、MachineName を指定する必要はありません。MachineName を指定しなかった場合は、ローカル コンピュータ "." が想定されます。 |
イベント ログに書き込む場合は、イベント Source を指定するか、または作成する必要があります。新しいイベント ソースを作成するには、コンピュータの管理者権限が必要です。Source は、アプリケーションを有効なソースとしてイベント ログに登録します。Source は、同時に 1 つのログに書き込むときだけ使用できます。Source には任意のランダムな文字列を指定できますが、コンピュータの他のソースとは別の一意の名前である必要があります。通常、ソース名には、アプリケーション名またはその他の識別用文字列を使用します。重複する Source 値を作成しようとすると、例外がスローされます。ただし、単一のイベント ログを複数のソースに関連付けることは可能です。
![]() |
---|
アプリケーションは、あらゆる登録済みのソース名で書き込みを行うことが可能で、これを防ぐ手段はありません。アプリケーションに Write アクセス許可が与えられている場合、コンピュータに登録されている有効なソースすべてに関するイベントを書き込むことができます。 |
アプリケーションおよびサービスは、アプリケーション ログまたはカスタム ログに書き込みます。デバイス ドライバは、システム ログに書き込みます。Log プロパティを明示的に設定しない場合、イベント ログは既定のアプリケーション ログに設定されます。
イベントをイベント ログに書き込むには、WriteEvent と WriteEntry を使用します。イベントを書き込むには、イベント ソースを指定することが必要です。イベント ソースは、そのソースを持つ最初のエントリを書き込む前に作成および構成しておく必要があります。
アプリケーションのインストール時に新しいイベント ソースを作成します。これにより、オペレーティング システムが、登録されたイベント ソースとその構成の一覧を更新するだけの時間的余裕が生まれます。イベント ソースの一覧がオペレーティング システムにより更新されていないとき、新しいソースでイベントを書き込もうとすると、書き込み操作が失敗します。新しいソースは、EventLogInstaller または CreateEventSource メソッドを使用して構成できます。新しいイベント ソースを作成するには、コンピュータの管理者権限が必要です。
各ソースは同時に 1 つのログだけに登録できます。ただし、アプリケーションでは、複数のイベント ログに書き込むために複数のソースが使用される場合があります。たとえば、アプリケーションには、異なるイベント ログまたは異なるリソース ファイル用に構成された複数のソースが必要になる場合があります。既存のソースの構成情報を変更するには、一度ソースを削除してから、新しい構成で作成し直す必要があります。他のアプリケーションまたはコンポーネントが既存のソースを使用している場合、既存のソースを削除するのではなく、更新された構成で新しいソースを作成します。
イベント カテゴリおよびメッセージ文字列用のローカライズされたリソースを持つイベント ソースを登録できます。アプリケーションは、実際の文字列値を指定するのではなく、リソース識別子を使用してイベント ログ エントリを書き込むことができます。リソース ファイルを使用したソースの構成については、EventLogInstaller クラスおよび EventSourceCreationData クラスのトピックを参照してください。
アプリケーションが文字列値をイベント ログに直接書き込む場合は、ソースにリソース ファイルのプロパティを設定する必要はありません。ソースは、ローカライズされたエントリを書き込むか、または直接の文字列を書き込むように構成されている必要があります。アプリケーションがリソース識別子と文字列値の両方を使用してエントリを書き込む場合、2 つの異なるソースを登録する必要があります。たとえば、複数のリソース ファイルを持つ 1 つのソースを構成してから、WriteEvent メソッドでこのソースを使用し、リソース識別子によってエントリをイベント ログに書き込みます。次に、リソース ファイルを使わずに作成した別のソースを WriteEntry メソッドで使用し、そのソースを使って文字列を直接イベント ログに書き込みます。
イベントを書き込む場合は、少なくともメッセージ文字列またはメッセージ文字列のリソース識別子を指定する必要があります。他のイベント プロパティは省略可能です。省略可能なイベント設定の例を次に示します。EventLogEntryType を設定して、イベント ビューアがエントリに表示するアイコンを指定できます。アプリケーションがイベントのフィルタにカテゴリを使用する場合は、イベントのカテゴリ識別子を指定できます。追加情報を指定したイベントに関連付ける必要がある場合は、イベント エントリにバイナリ データを追加できます。
EventLog クラスは、個別のイベント ログとそのエントリへのアクセスを提供するだけではなく、すべてのイベント ログのコレクションへのアクセスも提供します。EventLog のstatic メンバを使用すると、ログの削除、ログ リストの取得、ソースの作成または削除、特定のソースがコンピュータに既に存在するかどうかの確認などを行うことができます。
アプリケーション ログ、システム ログ、セキュリティ ログの 3 つの既定のイベント ログがあります。Active Directory など、インストールされた他のアプリケーションやサービスでは追加のイベント ログを使用できます。EventLog を使用してカスタム イベント ログを作成できます。カスタム イベント ログはサーバーのイベント ビューアで表示できます。イベント ビューアにイベント ログのローカライズされた名前を表示させるには、RegisterDisplayName メソッドを使用します。最大ログ サイズに達した場合のイベント ログの動作を構成するには、ModifyOverflowPolicy メソッドを使用します。
イベントのログはディスク容量やプロセッサ時間、その他のシステム リソースを消費します。このため、必要な情報だけをログすることが重要です。パフォーマンスの低下を避けるために、イベント ログの呼び出しはメインのコード パスではなくエラー パスに配置することをお勧めします。
EventLog のインスタンスの初期プロパティ値の一覧については、EventLog コンストラクタのトピックを参照してください。
Windows 98, Windows Millennium Edition プラットフォームメモ : イベント ログは、Windows 98 または Windows Millennium Edition (Me) ではサポートされていません。

ソースが存在しない場合は MySource を作成し、イベント ログ MyNewLog にエントリを書き込む例を次に示します。
Option Explicit Option Strict Imports System Imports System.Diagnostics Imports System.Threading Class MySample Public Shared Sub Main() ' Create the source, if it does not already exist. If Not EventLog.SourceExists("MySource") Then EventLog.CreateEventSource("MySource", "MyNewLog") Console.WriteLine("CreatingEventSource") End If ' Create an EventLog instance and assign its source. Dim myLog As New EventLog() myLog.Source = "MySource" ' Write an informational entry to the event log. myLog.WriteEntry("Writing to event log.") End Sub 'Main End Class 'MySample
using System; using System.Diagnostics; using System.Threading; class MySample{ public static void Main(){ // Create the source, if it does not already exist. if(!EventLog.SourceExists("MySource")){ EventLog.CreateEventSource("MySource", "MyNewLog"); Console.WriteLine("CreatingEventSource"); } // Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.Source = "MySource"; // Write an informational entry to the event log. myLog.WriteEntry("Writing to event log."); } }
#using <System.dll> using namespace System; using namespace System::Diagnostics; using namespace System::Threading; int main() { // Create the source, if it does not already exist. if ( !EventLog::SourceExists( "MySource" ) ) { EventLog::CreateEventSource( "MySource", "MyNewLog" ); Console::WriteLine( "CreatingEventSource" ); } // Create an EventLog instance and assign its source. EventLog^ myLog = gcnew EventLog; myLog->Source = "MySource"; // Write an informational entry to the event log. myLog->WriteEntry( "Writing to event log." ); }
import System.*; import System.Diagnostics.*; import System.Threading.*; class MySample { public static void main(String[] args) { // Create the source, if it does not already exist. if (!(EventLog.SourceExists("MySource"))) { EventLog.CreateEventSource("MySource", "MyNewLog"); Console.WriteLine("CreatingEventSource"); } // Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.set_Source("MySource"); // Write an informational entry to the event log. myLog.WriteEntry("Writing to event log."); } //main } //MySample

System.MarshalByRefObject
System.ComponentModel.Component
System.Diagnostics.EventLog


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventLog コンストラクタ ()
アセンブリ: System (system.dll 内)


WriteEntry を呼び出す前に、EventLog インスタンスの Source プロパティを指定します。ログから Entries だけを読み取る場合は、Log プロパティと MachineName プロパティだけを指定する方法もあります。
![]() |
---|
EventLog のインスタンスの初期プロパティ値を次の表に示します。

ソースが存在しない場合は MySource を作成し、イベント ログ MyNewLog にエントリを書き込む例を次に示します。
Option Explicit Option Strict Imports System Imports System.Diagnostics Imports System.Threading Class MySample Public Shared Sub Main() ' Create the source, if it does not already exist. If Not EventLog.SourceExists("MySource") Then EventLog.CreateEventSource("MySource", "MyNewLog") Console.WriteLine("CreatingEventSource") End If ' Create an EventLog instance and assign its source. Dim myLog As New EventLog() myLog.Source = "MySource" ' Write an informational entry to the event log. myLog.WriteEntry("Writing to event log.") End Sub 'Main End Class 'MySample
using System; using System.Diagnostics; using System.Threading; class MySample{ public static void Main(){ // Create the source, if it does not already exist. if(!EventLog.SourceExists("MySource")){ EventLog.CreateEventSource("MySource", "MyNewLog"); Console.WriteLine("CreatingEventSource"); } // Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.Source = "MySource"; // Write an informational entry to the event log. myLog.WriteEntry("Writing to event log."); } }
#using <System.dll> using namespace System; using namespace System::Diagnostics; using namespace System::Threading; int main() { // Create the source, if it does not already exist. if ( !EventLog::SourceExists( "MySource" ) ) { EventLog::CreateEventSource( "MySource", "MyNewLog" ); Console::WriteLine( "CreatingEventSource" ); } // Create an EventLog instance and assign its source. EventLog^ myLog = gcnew EventLog; myLog->Source = "MySource"; // Write an informational entry to the event log. myLog->WriteEntry( "Writing to event log." ); }
import System.*; import System.Diagnostics.*; import System.Threading.*; class MySample { public static void main(String[] args) { // Create the source, if it does not already exist. if (!(EventLog.SourceExists("MySource"))) { EventLog.CreateEventSource("MySource", "MyNewLog"); Console.WriteLine("CreatingEventSource"); } // Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.set_Source("MySource"); // Write an informational entry to the event log. myLog.WriteEntry("Writing to event log."); } //main } //MySample


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventLog コンストラクタ (String, String)
アセンブリ: System (system.dll 内)



このオーバーロードは、Log プロパティにlogName パラメータを設定し、MachineName プロパティに machineName パラメータを設定します。WriteEntry を呼び出す前に、EventLog の Source プロパティを指定します。ログから Entries だけを読み取る場合は、Log プロパティと MachineName プロパティだけを指定する方法もあります。
![]() |
---|
このコンストラクタのオーバーロードで Log プロパティおよび MachineName プロパティが指定されますが、どちらも Entries プロパティを読み取る前に変更できます。 |
EventLog のインスタンスの初期プロパティ値を次の表に示します。

コンピュータ "myServer" 上のイベント ログ "myNewLog" のエントリを読み取る例を次に示します。
Option Explicit Option Strict Imports System Imports System.Diagnostics Imports System.Threading Imports Microsoft.VisualBasic Class MySample Public Shared Sub Main() ' Create an EventLog instance and assign its log name. Dim myLog As New EventLog("myNewLog", "myServer") ' Read the event log entries. Dim entry As EventLogEntry For Each entry In myLog.Entries Console.WriteLine((ControlChars.Tab & "Entry: " & entry.Message)) Next entry End Sub ' Main End Class ' MySample
using System; using System.Diagnostics; using System.Threading; class MySample{ public static void Main(){ // Create an EventLog instance and assign its log name. EventLog myLog = new EventLog("myNewLog", "myServer"); // Read the event log entries. foreach(EventLogEntry entry in myLog.Entries){ Console.WriteLine("\tEntry: " + entry.Message); } } }
#using <System.dll> using namespace System; using namespace System::Diagnostics; using namespace System::Threading; int main() { // Create an EventLog instance and assign its log name. EventLog^ myLog = gcnew EventLog( "myNewLog","myServer" ); // Read the event log entries. System::Collections::IEnumerator^ myEnum = myLog->Entries->GetEnumerator(); while ( myEnum->MoveNext() ) { EventLogEntry^ entry = safe_cast<EventLogEntry^>(myEnum->Current); Console::WriteLine( "\tEntry: {0}", entry->Message ); } }
import System.*; import System.Diagnostics.*; import System.Threading.*; class MySample { public static void main(String[] args) { // Create an EventLog instance and assign its log name. EventLog myLog = new EventLog("myNewLog", "myServer"); // Read the event log entries. for (int iCtr = 0; iCtr < myLog.get_Entries().get_Count(); iCtr++) { EventLogEntry entry = myLog.get_Entries().get_Item(iCtr); Console.WriteLine("\tEntry: " + entry.get_Message()); } } //main } //MySample


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventLog コンストラクタ (String)
アセンブリ: System (system.dll 内)



このオーバーロードは、Log プロパティに logName パラメータを設定します。WriteEntry を呼び出す前に、EventLog インスタンスの Source プロパティを指定します。ログから Entries だけを読み取る場合は、Log プロパティと MachineName プロパティだけを指定する方法もあります。
![]() |
---|
MachineName を指定しなかった場合は、ローカル コンピュータ (".") が想定されます。このコンストラクタのオーバーロードで Log プロパティが指定されますが、このプロパティは Entries プロパティを読み取る前に変更できます。 |
Source プロパティに指定したソースがコンピュータ上の他のソースとは異なる一意のソースである場合、後続の WriteEntry 呼び出しで、指定した名前のログが作成されます (ログがまだ存在しない場合)。
EventLog のインスタンスの初期プロパティ値を次の表に示します。

ローカル コンピュータ上のイベント ログ "myNewLog" のエントリを読み取る例を次に示します。
Option Explicit Option Strict Imports System Imports System.Diagnostics Imports System.Threading Imports Microsoft.VisualBasic Class MySample Public Shared Sub Main() ' Create an EventLog instance and assign its log name. Dim myLog As New EventLog("myNewLog") ' Read the event log entries. Dim entry As EventLogEntry For Each entry In myLog.Entries Console.WriteLine((ControlChars.Tab & "Entry: " & entry.Message)) Next entry End Sub ' Main End Class ' MySample
using System; using System.Diagnostics; using System.Threading; class MySample{ public static void Main(){ // Create an EventLog instance and assign its log name. EventLog myLog = new EventLog("myNewLog"); // Read the event log entries. foreach(EventLogEntry entry in myLog.Entries){ Console.WriteLine("\tEntry: " + entry.Message); } } }
#using <System.dll> using namespace System; using namespace System::Diagnostics; using namespace System::Threading; int main() { // Create an EventLog instance and assign its log name. EventLog^ myLog = gcnew EventLog( "myNewLog" ); // Read the event log entries. System::Collections::IEnumerator^ myEnum = myLog->Entries->GetEnumerator(); while ( myEnum->MoveNext() ) { EventLogEntry^ entry = safe_cast<EventLogEntry^>(myEnum->Current); Console::WriteLine( "\tEntry: {0}", entry->Message ); } }
import System.*; import System.Diagnostics.*; import System.Threading.*; class MySample { public static void main(String[] args) { // Create an EventLog instance and assign its log name. EventLog myLog = new EventLog("myNewLog"); // Read the event log entries. for (int iCtr = 0; iCtr < myLog.get_Entries().get_Count(); iCtr++) { EventLogEntry entry = myLog.get_Entries().get_Item(iCtr); Console.WriteLine("\tEntry: " + entry.get_Message()); } } //main } //MySample


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventLog コンストラクタ

名前 | 説明 |
---|---|
EventLog () | EventLog クラスの新しいインスタンスを初期化します。このインスタンスは、ログとは関連付けられません。 |
EventLog (String) | EventLog クラスの新しいインスタンスを初期化します。ローカル コンピュータ上のログにインスタンスを関連付けます。 |
EventLog (String, String) | EventLog クラスの新しいインスタンスを初期化します。指定したコンピュータ上のログにインスタンスを関連付けます。 |
EventLog (String, String, String) | EventLog クラスの新しいインスタンスを初期化します。指定したコンピュータ上のログにインスタンスを関連付け、指定したソースを作成するか、または EventLog に割り当てます。 |

EventLog コンストラクタ (String, String, String)
アセンブリ: System (system.dll 内)

Dim logName As String Dim machineName As String Dim source As String Dim instance As New EventLog(logName, machineName, source)


このコンストラクタは、Log プロパティに logName パラメータを設定し、MachineName プロパティに machineName パラメータを設定し、Source プロパティに source を設定します。Source プロパティは、イベント ログに書き込むときに必要です。しかし、イベント ログを読み取るだけの場合は、Log プロパティと MachineName プロパティだけが必要です (サーバー上のイベント ログに、そのログに関連付けられているソースが既に存在する場合)。イベント ログを読み取るだけの場合は、コンストラクタのもう 1 つのオーバーロードを使用するだけで十分です。
EventLog のインスタンスの初期プロパティ値を次の表に示します。

ソース "MySource" を使用して、ローカル コンピュータ上のイベント ログ "MyNewLog" にエントリを書き込む例を次に示します。
Option Strict Option Explicit Imports System Imports System.Diagnostics Imports System.Threading Class MySample Public Shared Sub Main() ' Create an EventLog instance and assign its source. Dim myLog As New EventLog("myNewLog", ".", "MySource") ' Write an entry to the log. myLog.WriteEntry(("Writing to event log on " & myLog.MachineName)) End Sub ' Main End Class ' MySample
using System; using System.Diagnostics; using System.Threading; class MySample{ public static void Main(){ // Create an EventLog instance and assign its source. EventLog myLog = new EventLog("myNewLog", ".", "MySource"); // Write an entry to the log. myLog.WriteEntry("Writing to event log on " + myLog.MachineName); } }
#using <System.dll> using namespace System; using namespace System::Diagnostics; using namespace System::Threading; int main() { // Create an EventLog instance and assign its source. EventLog^ myLog = gcnew EventLog( "myNewLog",".","MySource" ); // Write an entry to the log. myLog->WriteEntry( String::Format( "Writing to event log on {0}", myLog->MachineName ) ); }
import System.*; import System.Diagnostics.*; import System.Threading.*; class MySample { public static void main(String[] args) { // Create an EventLog instance and assign its source. EventLog myLog = new EventLog("myNewLog", ".", "MySource"); // Write an entry to the log. myLog.WriteEntry("Writing to event log on " + myLog.get_MachineName()); } //main } //MySample


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventLog プロパティ

名前 | 説明 | |
---|---|---|
![]() | Container | Component を格納している IContainer を取得します。 ( Component から継承されます。) |
![]() | EnableRaisingEvents | EventLog が EntryWritten イベント通知を受信するかどうかを示す値を取得または設定します。 |
![]() | Entries | イベント ログの内容を取得します。 |
![]() | Log | 読み取るログまたは書き込むログの名前を取得または設定します。 |
![]() | LogDisplayName | イベント ログの表示名を取得します。 |
![]() | MachineName | イベントを読み取るコンピュータまたは書き込むコンピュータの名前を取得または設定します。 |
![]() | MaximumKilobytes | イベント ログの最大サイズをキロバイト単位で取得または設定します。 |
![]() | MinimumRetentionDays | イベント ログ内のエントリを保持する日数を取得します。 |
![]() | OverflowAction | イベント ログが最大ファイル サイズに達した場合に、新しいエントリを格納するように構成された動作を取得します。 |
![]() | Site | Component の ISite を取得または設定します。 ( Component から継承されます。) |
![]() | Source | イベント ログを書き込むときに登録して使用するソース名を取得または設定します。 |
![]() | SynchronizingObject | EventLog エントリ書き込みイベントの結果として発行されるイベント ハンドラ呼び出しをマーシャリングするために使用するオブジェクトを取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。 ( Component から継承されます。) |
![]() | DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。 ( Component から継承されます。) |
![]() | Events | Component に結び付けられているイベント ハンドラのリストを取得します。 ( Component から継承されます。) |

EventLog メソッド


名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 オーバーライドされます。 EventLog によって使用されているリソースを解放します。 |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 ( Component から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 ( Component から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |

EventLog メンバ
EventLog データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Container | Component を格納している IContainer を取得します。(Component から継承されます。) |
![]() | EnableRaisingEvents | EventLog が EntryWritten イベント通知を受信するかどうかを示す値を取得または設定します。 |
![]() | Entries | イベント ログの内容を取得します。 |
![]() | Log | 読み取るログまたは書き込むログの名前を取得または設定します。 |
![]() | LogDisplayName | イベント ログの表示名を取得します。 |
![]() | MachineName | イベントを読み取るコンピュータまたは書き込むコンピュータの名前を取得または設定します。 |
![]() | MaximumKilobytes | イベント ログの最大サイズをキロバイト単位で取得または設定します。 |
![]() | MinimumRetentionDays | イベント ログ内のエントリを保持する日数を取得します。 |
![]() | OverflowAction | イベント ログが最大ファイル サイズに達した場合に、新しいエントリを格納するように構成された動作を取得します。 |
![]() | Site | Component の ISite を取得または設定します。(Component から継承されます。) |
![]() | Source | イベント ログを書き込むときに登録して使用するソース名を取得または設定します。 |
![]() | SynchronizingObject | EventLog エントリ書き込みイベントの結果として発行されるイベント ハンドラ呼び出しをマーシャリングするために使用するオブジェクトを取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。(Component から継承されます。) |
![]() | DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。(Component から継承されます。) |
![]() | Events | Component に結び付けられているイベント ハンドラのリストを取得します。(Component から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 オーバーライドされます。 EventLog によって使用されているリソースを解放します。 |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 (Component から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 (Component から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Disposed | コンポーネントの Disposed イベントを待機するイベント ハンドラを追加します。(Component から継承されます。) |
![]() | EntryWritten | ローカル コンピュータ上のイベント ログにエントリが書き込まれたときに発生します。 |

- EventLogのページへのリンク