EventLog.Log プロパティ
アセンブリ: System (system.dll 内)

ログの名前。ログ名には、アプリケーション ログ名、システム ログ名、セキュリティ ログ名、またはカスタム ログ名を指定できます。既定値は空の文字列 ("") です。

既定では、サーバー上に 3 つのログ ファイル (アプリケーション、システム、セキュリティ) があります。アプリケーションおよびサービスは、アプリケーション ログ ファイルを使用します。デバイス ドライバは、システム ログ ファイルを使用します。監査がオンのとき、システムはセキュリティ ログに監査正常終了イベントおよび監査エラー イベントを生成します。Windows サーバー上に Active Directory のような他のアプリケーションがインストールされている場合は、その他の既定ログ ファイルが存在することもあります。さらに、ローカル コンピュータやリモート コンピュータ上にカスタム ログ ファイルを作成できます。カスタム ログを使用すると、既定値であるアプリケーション ログにイベントを書き込む場合に比べてエントリをより詳細に編成できます。
![]() |
---|
Log プロパティに存在しないログの名前を設定した場合は、システムによって EventLog がアプリケーション ログに関連付けられますが、指定したログ以外のログが使用されていることは警告されません。 |

ローカル コンピュータ上のイベント ログ "NewEventLog" のエントリを読み取る例を次に示します。
Imports System Imports System.Diagnostics Imports Microsoft.VisualBasic Class MySample Public Shared Sub Main() Dim myNewLog As New EventLog() myNewLog.Log = "NewEventLog" Dim entry As EventLogEntry For Each entry In myNewLog.Entries Console.WriteLine((ControlChars.Tab & "Entry: " & entry.Message)) Next entry End Sub 'Main End Class 'MySample
using System; using System.Diagnostics; class MySample{ public static void Main(){ EventLog myNewLog = new EventLog(); myNewLog.Log = "NewEventLog"; foreach(EventLogEntry entry in myNewLog.Entries){ Console.WriteLine("\tEntry: " + entry.Message); } } }
#using <System.dll> using namespace System; using namespace System::Diagnostics; int main() { EventLog^ myNewLog = gcnew EventLog; myNewLog->Log = "NewEventLog"; System::Collections::IEnumerator^ myEnum = myNewLog->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.Collections.*; class MySample { public static void main(String[] args) { EventLog myNewLog = new EventLog(); myNewLog.set_Log("NewEventLog"); EventLogEntry entry; IEnumerator objEnum = myNewLog.get_Entries().GetEnumerator(); while (objEnum.MoveNext()) { entry = (EventLogEntry)objEnum.get_Current(); 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からEventLog.Log プロパティを検索する場合は、下記のリンクをクリックしてください。

- EventLog.Log プロパティのページへのリンク