EventSourceCreationData.LogName プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > EventSourceCreationData.LogName プロパティの意味・解説 

EventSourceCreationData.LogName プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ソースがエントリを書き込むイベント ログの名前を取得または設定します

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

Dim instance As EventSourceCreationData
Dim value As String

value = instance.LogName

instance.LogName = value
public string LogName { get;
 set; }
/** @property */
public String get_LogName ()

/** @property */
public void set_LogName (String value)

プロパティ
イベント ログの名前。ログ名には、アプリケーション ログ名、システム ログ名、またはカスタム ログ名を指定できます既定値は "Application" です。

解説解説

新しソース使用してアプリケーションがエントリを書き込むイベント ログ識別するには、LogName プロパティ使用しますイベント ログは、新規または既存ログ使用できますアプリケーションおよびサービスは、アプリケーション ログまたはカスタム ログ書き込みますデバイス ドライバは、システム ログ書き込みますLogName プロパティ明示的に設定しなかった場合は、既定によりアプリケーション ログ設定されます。

メモメモ

セキュリティ ログ読み取り専用です。

新しソース用として既存ログイベント ログ指定するには、LogName プロパティ既存イベント ログ名に設定しますソース新しイベント ログ作成するには、LogName プロパティ設定する必要がありますイベント ログ名は、印字可能な文字構成されている必要があります文字 '*'、'?'、または '\' を含めないでくださいイベント ログ名の最初の 8 文字は、指定されコンピュータ既存イベント ログ名の最初の 8 文字異なっている必要があります

オペレーティング システムでは、イベントログファイルとして保存されます。新しイベント ログ作成に EventLogInstaller または CreateEventSource メソッド使用すると、関連するファイルは、指定されコンピュータの %SystemRoot%\System32\Config ディレクトリ格納されます。ファイル名は、LogName プロパティ最初の 8 文字と ".evt" というファイル名拡張子付け加えることによって設定されます。

使用例使用例

コマンド ライン引数からイベント ソース構成プロパティ設定するコード例次に示します入力引数は、イベント ソース名、イベント ログ名、コンピュータ名、およびイベント メッセージ リソース ファイル指定します。このコード例は、EventSourceCreationData クラストピック取り上げているコード例一部分です。

Dim mySourceData As EventSourceCreationData
 = new EventSourceCreationData("",
 "")
Dim registerSource As Boolean
 = True

' Process input parameters.
If args.Length > 0
    ' Require at least the source name.

    mySourceData.Source = args(0)

    If args.Length > 1
   
        mySourceData.LogName = args(1)
    
    End If
    If args.Length > 2
   
        mySourceData.MachineName = args(2)
    
    End If
    If args.Length > 3 AndAlso args(3).Length
 > 0
   
        mySourceData.MessageResourceFile = args(3)
    
    End If

Else 
    ' Display a syntax help message.
    Console.WriteLine("Input:")
    Console.WriteLine(" source [event log] [machine name] [resource
 file]")

    registerSource = False
End If

' Set defaults for parameters missing input.
If mySourceData.MachineName.Length = 0

    ' Default to the local computer.
    mySourceData.MachineName = "."
End If
If mySourceData.LogName.Length = 0
    ' Default to the Application log.
    mySourceData.LogName = "Application"
End If
EventSourceCreationData mySourceData = new EventSourceCreationData("",
 "");
bool registerSource = true;

// Process input parameters.
if (args.Length > 0)
{
    // Require at least the source name.

    mySourceData.Source = args[0];

    if (args.Length > 1)
    {
        mySourceData.LogName = args[1];
    }

    if (args.Length > 2)
    {
        mySourceData.MachineName = args[2];
    }
    if ((args.Length > 3) && (args[3].Length > 0))
    {
        mySourceData.MessageResourceFile = args[3];
    }
}
else 
{
    // Display a syntax help message.
    Console.WriteLine("Input:");
    Console.WriteLine(" source [event log] [machine name] [resource file]");

    registerSource = false;
}

// Set defaults for parameters missing input.
if (mySourceData.MachineName.Length == 0)
{
    // Default to the local computer.
    mySourceData.MachineName = ".";
}
if (mySourceData.LogName.Length == 0)
{
    // Default to the Application log.
    mySourceData.LogName = "Application";
}
EventSourceCreationData ^ mySourceData = gcnew EventSourceCreationData( "",""
 );
bool registerSource = true;

// Process input parameters.
if ( args->Length > 1 )
{
   
   // Require at least the source name.
   mySourceData->Source = args[ 1 ];
   if ( args->Length > 2 )
   {
      mySourceData->LogName = args[ 2 ];
   }

   if ( args->Length > 3 )
   {
      mySourceData->MachineName = args[ 3 ];
   }

   if ( (args->Length > 4) && (args[ 4 ]->Length
 > 0) )
   {
      mySourceData->MessageResourceFile = args[ 4 ];
   }
}
else
{
   
   // Display a syntax help message.
   Console::WriteLine( "Input:" );
   Console::WriteLine( " source [event log] [machine name] [resource file]"
 );
   registerSource = false;
}


// Set defaults for parameters missing input.
if ( mySourceData->MachineName->Length == 0 )
{
   
   // Default to the local computer.
   mySourceData->MachineName = ".";
}

if ( mySourceData->LogName->Length == 0 )
{
   
   // Default to the Application log.
   mySourceData->LogName = "Application";
}


.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EventSourceCreationData クラス
EventSourceCreationData メンバ
System.Diagnostics 名前空間
EventLogInstaller.Log プロパティ
EventLog.Exists


このページでは「.NET Framework クラス ライブラリ リファレンス」からEventSourceCreationData.LogName プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からEventSourceCreationData.LogName プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からEventSourceCreationData.LogName プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

EventSourceCreationData.LogName プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



EventSourceCreationData.LogName プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS