EventSource クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
プラットフォーム間でイベント トレースのイベントを作成する機能を提供します。
public ref class EventSource : IDisposable
public class EventSource : IDisposable
type EventSource = class
interface IDisposable
Public Class EventSource
Implements IDisposable
- 継承
-
EventSource
- 派生
- 実装
例
次の例は、クラスの簡単な実装を EventSource 示しています。
using System.Diagnostics.Tracing;
namespace Demo1
{
sealed class MyCompanyEventSource : EventSource
{
public static MyCompanyEventSource Log = new MyCompanyEventSource();
public void Startup() { WriteEvent(1); }
public void OpenFileStart(string fileName) { WriteEvent(2, fileName); }
public void OpenFileStop() { WriteEvent(3); }
}
class Program1
{
static void Main(string[] args)
{
MyCompanyEventSource.Log.Startup();
// ...
MyCompanyEventSource.Log.OpenFileStart("SomeFile");
// ...
MyCompanyEventSource.Log.OpenFileStop();
}
}
}
Imports System.Diagnostics.Tracing
Class MyCompanyEventSource
Inherits EventSource
Public Shared Log As New MyCompanyEventSource()
Public Sub Startup()
WriteEvent(1)
End Sub
Public Sub OpenFileStart(ByVal fileName As String)
WriteEvent(2, fileName)
End Sub
Public Sub OpenFileStop()
WriteEvent(3)
End Sub
End Class
Class Program
Shared Sub Main(ByVal args() As String)
MyCompanyEventSource.Log.Startup()
' ...
MyCompanyEventSource.Log.OpenFileStart("SomeFile")
' ...
MyCompanyEventSource.Log.OpenFileStop()
End Sub
End Class
次の例は、クラスのより複雑な実装を EventSource 示しています。
using System;
using System.Diagnostics.Tracing;
namespace Demo2
{
enum MyColor { Red, Yellow, Blue };
[EventSource(Name = "MyCompany")]
sealed class MyCompanyEventSource : EventSource
{
public static class Keywords
{
public const EventKeywords Page = (EventKeywords)1;
public const EventKeywords DataBase = (EventKeywords)2;
public const EventKeywords Diagnostic = (EventKeywords)4;
public const EventKeywords Perf = (EventKeywords)8;
}
public static class Tasks
{
public const EventTask Page = (EventTask)1;
public const EventTask DBQuery = (EventTask)2;
}
[Event(1, Message = "Application Failure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)]
public void Failure(string message) { WriteEvent(1, message); }
[Event(2, Message = "Starting up.", Keywords = Keywords.Perf, Level = EventLevel.Informational)]
public void Startup() { WriteEvent(2); }
[Event(3, Message = "loading page {1} activityID={0}", Opcode = EventOpcode.Start,
Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStart(int ID, string url) { if (IsEnabled()) WriteEvent(3, ID, url); }
[Event(4, Opcode = EventOpcode.Stop, Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStop(int ID) { if (IsEnabled()) WriteEvent(4, ID); }
[Event(5, Opcode = EventOpcode.Start, Task = Tasks.DBQuery, Keywords = Keywords.DataBase, Level = EventLevel.Informational)]
public void DBQueryStart(string sqlQuery) { WriteEvent(5, sqlQuery); }
[Event(6, Opcode = EventOpcode.Stop, Task = Tasks.DBQuery, Keywords = Keywords.DataBase, Level = EventLevel.Informational)]
public void DBQueryStop() { WriteEvent(6); }
[Event(7, Level = EventLevel.Verbose, Keywords = Keywords.DataBase)]
public void Mark(int ID) { if (IsEnabled()) WriteEvent(7, ID); }
[Event(8)]
public void LogColor(MyColor color) { WriteEvent(8, (int) color); }
public static MyCompanyEventSource Log = new MyCompanyEventSource();
}
class Program
{
static void Main(string[] args)
{
MyCompanyEventSource.Log.Startup();
Console.WriteLine("Starting up");
MyCompanyEventSource.Log.DBQueryStart("Select * from MYTable");
var url = "http://localhost";
for (int i = 0; i < 10; i++)
{
MyCompanyEventSource.Log.PageStart(i, url);
MyCompanyEventSource.Log.Mark(i);
MyCompanyEventSource.Log.PageStop(i);
}
MyCompanyEventSource.Log.DBQueryStop();
MyCompanyEventSource.Log.LogColor(MyColor.Blue);
MyCompanyEventSource.Log.Failure("This is a failure 1");
MyCompanyEventSource.Log.Failure("This is a failure 2");
MyCompanyEventSource.Log.Failure("This is a failure 3");
}
}
}
Imports System.Diagnostics.Tracing
Enum MyColor
Red
Yellow
Blue
End Enum 'MyColor
<EventSource(Name:="MyCompany")> _
Class MyCompanyEventSource
Inherits EventSource
Public Class Keywords
Public Const Page As EventKeywords = CType(1, EventKeywords)
Public Const DataBase As EventKeywords = CType(2, EventKeywords)
Public Const Diagnostic As EventKeywords = CType(4, EventKeywords)
Public Const Perf As EventKeywords = CType(8, EventKeywords)
End Class
Public Class Tasks
Public Const Page As EventTask = CType(1, EventTask)
Public Const DBQuery As EventTask = CType(1, EventTask)
End Class
<[Event](1, Message:="Application Failure: {0}", Level:=EventLevel.Error, Keywords:=Keywords.Diagnostic)> _
Public Sub Failure(ByVal message As String)
WriteEvent(1, message)
End Sub
<[Event](2, Message:="Starting up.", Keywords:=Keywords.Perf, Level:=EventLevel.Informational)> _
Public Sub Startup()
WriteEvent(2)
End Sub
<[Event](3, Message:="loading page {1} activityID={0}", Opcode:=EventOpcode.Start, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)> _
Public Sub PageStart(ByVal ID As Integer, ByVal url As String)
If IsEnabled() Then
WriteEvent(3, ID, url)
End If
End Sub
<[Event](4, Opcode:=EventOpcode.Stop, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)> _
Public Sub PageStop(ByVal ID As Integer)
If IsEnabled() Then
WriteEvent(4, ID)
End If
End Sub
<[Event](5, Opcode:=EventOpcode.Start, Task:=Tasks.DBQuery, Keywords:=Keywords.DataBase, Level:=EventLevel.Informational)> _
Public Sub DBQueryStart(ByVal sqlQuery As String)
WriteEvent(5, sqlQuery)
End Sub
<[Event](6, Opcode:=EventOpcode.Stop, Task:=Tasks.DBQuery, Keywords:=Keywords.DataBase, Level:=EventLevel.Informational)> _
Public Sub DBQueryStop()
WriteEvent(6)
End Sub
<[Event](7, Level:=EventLevel.Verbose, Keywords:=Keywords.DataBase)> _
Public Sub Mark(ByVal ID As Integer)
If IsEnabled() Then
WriteEvent(7, ID)
End If
End Sub
<[Event](8)> _
Public Sub LogColor(ByVal color As MyColor)
WriteEvent(8, Fix(color))
End Sub
Public Shared Log As New MyCompanyEventSource()
End Class
Class Program
Shared Sub Main(ByVal args() As String)
MyCompanyEventSource.Log.Startup()
Console.WriteLine("Starting up")
MyCompanyEventSource.Log.DBQueryStart("Select * from MYTable")
Dim url As String = "http:'localhost"
Dim i As Integer
For i = 0 To 9
MyCompanyEventSource.Log.PageStart(i, url)
MyCompanyEventSource.Log.Mark(i)
MyCompanyEventSource.Log.PageStop(i)
Next i
MyCompanyEventSource.Log.DBQueryStop()
MyCompanyEventSource.Log.LogColor(MyColor.Blue)
MyCompanyEventSource.Log.Failure("This is a failure 1")
MyCompanyEventSource.Log.Failure("This is a failure 2")
MyCompanyEventSource.Log.Failure("This is a failure 3")
End Sub
End Class
高度な使用方法
従来、ユーザー定義 EventSource オブジェクトは直接継承することを想定しています EventSource。 ただし、高度なシナリオでは、ユーティリティ ソース と呼ばれるオブジェクトを作成abstract
EventSourceし、インターフェイスを実装できます。 これらの手法の 1 つまたは両方を使用すると、異なる派生ソース間でコードを共有できます。
重要
抽象 EventSource オブジェクトは、キーワード、タスク、オペコード、チャネル、またはイベントを定義できません。
重要
イベント メタデータを生成するときに実行時に名前の競合を回避するために、インターフェイスを使用 EventSourceする場合は、インターフェイス メソッドを明示的に実装しないでください。
次の例は、インターフェイスを使用する実装 EventSource を示しています。
public interface IMyLogging
{
void Error(int errorCode, string message);
void Warning(string message);
}
public sealed class MySource : EventSource, IMyLogging
{
public static MySource Log = new();
[Event(1)]
public void Error(int errorCode, string message) => WriteEvent(1, errorCode, message);
[Event(2)]
public void Warning(string message) => WriteEvent(2, message);
}
次の例は、Utility EventSource パターンを使用する実装 EventSource を示しています。
public abstract class UtilBaseEventSource : EventSource
{
protected UtilBaseEventSource()
: base()
{ }
protected UtilBaseEventSource(bool throwOnEventWriteErrors)
: base(throwOnEventWriteErrors)
{ }
// helper overload of WriteEvent for optimizing writing an event containing
// payload properties that don't align with a provided overload. This prevents
// EventSource from using the object[] overload which is expensive.
protected unsafe void WriteEvent(int eventId, int arg1, short arg2, long arg3)
{
if (IsEnabled())
{
EventSource.EventData* descrs = stackalloc EventSource.EventData[3];
descrs[0] = new EventData { DataPointer = (IntPtr)(&arg1), Size = 4 };
descrs[1] = new EventData { DataPointer = (IntPtr)(&arg2), Size = 2 };
descrs[2] = new EventData { DataPointer = (IntPtr)(&arg3), Size = 8 };
WriteEventCore(eventId, 3, descrs);
}
}
}
public sealed class OptimizedEventSource : UtilBaseEventSource
{
public static OptimizedEventSource Log = new();
public static class Keywords
{
public const EventKeywords Kwd1 = (EventKeywords)1;
}
[Event(1, Keywords = Keywords.Kwd1, Level = EventLevel.Informational, Message = "LogElements called {0}/{1}/{2}.")]
public void LogElements(int n, short sh, long l) => WriteEvent(1, n, sh, l); // uses the overload we added!
}
次の例は、ライブラリ内のコンポーネントに EventSource 関するトレース情報の実装を示しています。
public class ComplexComponent : IDisposable
{
internal static Dictionary<string, string> _internalState = new();
private string _name;
public ComplexComponent(string name)
{
_name = name ?? throw new ArgumentNullException(nameof(name));
ComplexSource.Log.NewComponent(_name);
}
public void SetState(string key, string value)
{
lock (_internalState)
{
_internalState[key] = value;
ComplexSource.Log.SetState(_name, key, value);
}
}
private void ExpensiveWork1() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
private void ExpensiveWork2() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
private void ExpensiveWork3() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
private void ExpensiveWork4() => System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(250));
public void DoWork()
{
ComplexSource.Log.ExpensiveWorkStart(_name);
ExpensiveWork1();
ExpensiveWork2();
ExpensiveWork3();
ExpensiveWork4();
ComplexSource.Log.ExpensiveWorkStop(_name);
}
public void Dispose()
{
ComplexSource.Log.ComponentDisposed(_name);
}
}
internal sealed class ComplexSource : EventSource
{
public static ComplexSource Log = new();
public static class Keywords
{
public const EventKeywords ComponentLifespan = (EventKeywords)1;
public const EventKeywords StateChanges = (EventKeywords)(1 << 1);
public const EventKeywords Performance = (EventKeywords)(1 << 2);
public const EventKeywords DumpState = (EventKeywords)(1 << 3);
// a utility keyword for a common combination of keywords users might enable
public const EventKeywords StateTracking = ComponentLifespan & StateChanges & DumpState;
}
protected override void OnEventCommand(EventCommandEventArgs args)
{
base.OnEventCommand(args);
if (args.Command == EventCommand.Enable)
{
DumpComponentState();
}
}
[Event(1, Keywords = Keywords.ComponentLifespan, Message = "New component with name '{0}'.")]
public void NewComponent(string name) => WriteEvent(1, name);
[Event(2, Keywords = Keywords.ComponentLifespan, Message = "Component with name '{0}' disposed.")]
public void ComponentDisposed(string name) => WriteEvent(2, name);
[Event(3, Keywords = Keywords.StateChanges)]
public void SetState(string name, string key, string value) => WriteEvent(3, name, key, value);
[Event(4, Keywords = Keywords.Performance)]
public void ExpensiveWorkStart(string name) => WriteEvent(4, name);
[Event(5, Keywords = Keywords.Performance)]
public void ExpensiveWorkStop(string name) => WriteEvent(5, name);
[Event(6, Keywords = Keywords.DumpState)]
public void ComponentState(string key, string value) => WriteEvent(6, key, value);
[NonEvent]
public void DumpComponentState()
{
if (IsEnabled(EventLevel.Informational, Keywords.DumpState))
{
lock (ComplexComponent._internalState)
{
foreach (var (key, value) in ComplexComponent._internalState)
ComponentState(key, value);
}
}
}
}
注釈
このクラスは、イベント トレースに使用する特定のイベントを提供するユーザー クラスによって継承されることを目的としています。 イベント EventSource.WriteEvent をログに記録するためにメソッドが呼び出されます。
の基本的な機能 EventSource は、ほとんどのアプリケーションで十分です。 作成されたイベント メタデータをより詳細に制御する場合は、メソッドに属性を EventAttribute 適用できます。 高度なイベント ソース アプリケーションの場合は、派生イベント ソースに送信されるコマンドをインターセプトしてフィルター処理を変更したり、継承元によってアクション (データ構造のダンプなど) を実行したりすることができます。 イベント ソースは、EventPipe ベースのツール (Windows 用イベント トレース (ETW) PerfView
ベースのツールなどdotnet-trace
) を使用して、インプロセスEventListenerでアクティブ化したり、プロセス外でアクティブ化したりできますLogman
。 プログラムでデータ ディスパッチャーを制御およびインターセプトすることもできます。 このクラスには EventListener 、追加の機能が用意されています。
規約
EventSource派生クラスは、次の規則に従う必要があります。
- ユーザー定義クラスでは、シングルトン パターンを実装する必要があります。 シングルトン インスタンスの名前
Log
は、従来は . 拡張機能では、ユーザーは手動で呼び出IDisposable.Dispose
す必要があり、マネージド コードの実行の最後にランタイムがシングルトン インスタンスをクリーンアップできるようにする必要があります。 - 「高度な使用法」セクションで説明されている高度な "Utility EventSource" 構成を実装していない限り、ユーザー定義の派生クラスをマーク
sealed
する必要があります。 - イベントの発生に関連するリソース集中型の作業を実行する前に呼び出 IsEnabled() します。
- EventTask名前付けパターン
<EventName>Start``<EventName>Stop
と . これらのイベントは、クラス定義内で互いに隣り合って宣言する 必要 があり、メソッドが先に<EventName>Start
来る 必要があります 。 - オブジェクトの下位互換性を維持 EventSource し、適切なバージョン管理を試みます。 イベントの既定のバージョンは
0
. バージョンは設定 Versionで変更できます。 ペイロードのプロパティを変更するたびに、イベントのバージョンを変更します。 常に、イベント宣言の最後に新しいペイロード プロパティを追加します。 これができない場合は、新しい ID を持つ新しいイベントを作成して古いイベントを置き換えます。 - イベント メソッドを宣言する場合は、可変サイズのプロパティの前に固定サイズのペイロード プロパティを指定します。
- EventKeywords は、プロバイダーをサブスクライブするときに特定のイベントを指定するためのビット マスクとして使用されます。 キーワードを指定するには、メンバーを含
public const EventKeywords
むpublic static class Keywords
メンバー クラスを定義します。 - 高価なイベントを using EventAttributeにEventKeywords関連付けます。 このパターンを使用すると、ユーザーはこれらの EventSource 高価な操作をオプトアウトできます。
自己記述 (トレース ログ) 形式とマニフェスト イベント形式の比較
EventSource は、使用されるコンストラクターまたは設定されているフラグに基づいて、2 つの異なるモードに EventSourceOptions構成できます。
これまで、これら 2 つの形式は、Windows イベント トレース (ETW) で使用される 2 つの形式から派生しています。 これら 2 つのモードは、Windows イベント トレース (ETW) または EventPipe ベースのリスナーを使用する機能には影響しませんが、イベントのメタデータは異なる方法で生成されます。
既定のイベント形式は EtwManifestEventFormat、指定されていない場合に設定されます EventSourceSettings。 マニフェスト ベース EventSource のオブジェクトは、初期化時にクラスで定義されたイベントを表す XML ドキュメントを生成します。 これには、プロバイダーとイベントの EventSource メタデータを生成するために、それ自体を反映する必要があります。
自己記述 (トレース ログ) イベント形式を使用するには、コンストラクター、EventSourceEventSource(String)コンストラクター、またはフラグをEventSource(String, EventSourceSettings)設定EtwSelfDescribingEventFormat
EventSourceSettingsして作成します。 自己記述型ソースは、初期化時に最小限のプロバイダー メタデータを生成し、呼び出されたときにのみ Write(String) イベント メタデータを生成します。
実際には、これらのイベント形式の設定は、Windows のイベント トレース (ETW) に基づくリーダーの使用状況にのみ影響します。 ただし、リフレクションとメタデータの生成に必要な時間が原因で、初期化時間とイベントごとの書き込み時間に小さな影響を与える可能性があります。
コンストラクター
EventSource() |
EventSource クラスの新しいインスタンスを作成します。 |
EventSource(Boolean) |
EventSource クラスの新しいインスタンスを作成し、基になる Windows コードでエラーが発生した場合に例外をスローするかどうかを指定します。 |
EventSource(EventSourceSettings) |
指定した構成設定を使用して EventSource クラスの新しいインスタンスを作成します。 |
EventSource(EventSourceSettings, String[]) |
指定した設定と特徴が含まれるコントラクト以外のイベントで使用される EventSource の新しいインスタンスを初期化します。 |
EventSource(String) |
指定した名前を使用して、EventSource クラスの新しいインスタンスを作成します。 |
EventSource(String, EventSourceSettings) |
指定した名前と設定を使用して、EventSource クラスの新しいインスタンスを作成します。 |
EventSource(String, EventSourceSettings, String[]) |
指定した構成設定を使用して EventSource クラスの新しいインスタンスを作成します。 |
プロパティ
ConstructionException |
イベント ソースの作成中にスローされた例外を取得します。 |
CurrentThreadActivityId |
現在のスレッドのアクティビティ ID を取得します。 |
Guid |
イベント ソースの一意の識別子。 |
Name |
イベント ソースから派生するクラスの表示名。 |
Settings |
このイベント ソースに適用される設定を取得します。 |
メソッド
Dispose() |
EventSource クラスの現在のインスタンスによって使用されているすべてのリソースを解放します。 |
Dispose(Boolean) |
EventSource クラスによって使用されているアンマネージド リソースを解放し、オプションでマネージド リソースも解放します。 |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
Finalize() |
オブジェクトが EventSource ガベージ コレクションによって解放される前に、リソースを解放し、その他のクリーンアップ操作を実行できるようにします。 |
GenerateManifest(Type, String) |
現在のイベント ソースに関連付けられている XML マニフェストの文字列を返します。 |
GenerateManifest(Type, String, EventManifestOptions) |
現在のイベント ソースに関連付けられている XML マニフェストの文字列を返します。 |
GetGuid(Type) |
イベント ソースのこの実装の一意の識別子を取得します。 |
GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
IsEnabled() |
現在のイベント ソースが有効かどうかを判断します。 |
IsEnabled(EventLevel, EventKeywords) |
指定したレベルとキーワードを持つ現在のイベント ソースが有効かどうかを判断します。 |
IsEnabled(EventLevel, EventKeywords, EventChannel) |
現在のイベント ソースが、指定したレベル、キーワード、およびチャネルを持つイベントに対して有効かどうかを判断します。 |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
OnEventCommand(EventCommandEventArgs) |
現在のイベント ソースがコントローラーによって更新されるときに呼び出されます。 |
SendCommand(EventSource, EventCommand, IDictionary<String,String>) |
指定されたイベント ソースにコマンドを送信します。 |
SetCurrentThreadActivityId(Guid) |
現在のスレッドのアクティビティ ID を設定します。 |
SetCurrentThreadActivityId(Guid, Guid) |
現在のスレッドでは、アクティビティ ID を設定し、前のアクティビティの ID を返します。 |
ToString() |
現在のイベント ソース インスタンスを文字列で表現したものを取得します。 |
ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
Write(String) |
フィールドを除いてイベントを書き込みます。ただし、指定した名前および既定のオプションを含みます。 |
Write(String, EventSourceOptions) |
フィールドを除いてイベントを書き込みます。ただし、指定した名前およびオプションを含みます。 |
Write<T>(String, EventSourceOptions, Guid, Guid, T) |
指定した名前、オプション、関連するアクティビティ、およびイベント データを使用してイベントを書き込みます。 |
Write<T>(String, EventSourceOptions, T) |
指定した名前、イベント データ、およびオプションを使用してイベントを書き込みます。 |
Write<T>(String, EventSourceOptions, T) |
指定した名前、オプション、およびイベント データを使用してイベントを書き込みます。 |
Write<T>(String, T) |
指定した名前とデータを使用してイベントを書き込みます。 |
WriteEvent(Int32) |
指定されたイベント識別子を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Byte[]) |
指定されたイベント識別子とバイト配列引数を使用してイベントを書き込みます。 |
WriteEvent(Int32, Int32) |
指定されたイベント識別子と 32 ビット整数引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int32, Int32) |
指定されたイベント識別子と 32 ビット整数引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int32, Int32, Int32) |
指定されたイベント識別子と 32 ビット整数引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int32, String) |
指定されたイベント識別子と 32 ビット整数および文字列引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int64) |
指定されたイベント識別子と 64 ビット整数引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int64, Byte[]) |
指定した識別子と 64 ビット整数およびバイト配列引数を使用して、イベント データを書き込みます。 |
WriteEvent(Int32, Int64, Int64) |
指定されたイベント識別子と 64 ビットの引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int64, Int64, Int64) |
指定されたイベント識別子と 64 ビットの引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Int64, String) |
指定されたイベント識別子と 64 ビット整数および文字列引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, Object[]) |
指定されたイベント識別子と引数の配列を使用して、イベントを書き込みます。 |
WriteEvent(Int32, String) |
指定されたイベント識別子と文字列引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, String, Int32) |
指定されたイベント識別子と引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, String, Int32, Int32) |
指定されたイベント識別子と引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, String, Int64) |
指定されたイベント識別子と引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, String, String) |
指定されたイベント識別子と文字列引数を使用して、イベントを書き込みます。 |
WriteEvent(Int32, String, String, String) |
指定されたイベント識別子と文字列引数を使用して、イベントを書き込みます。 |
WriteEventCore(Int32, Int32, EventSource+EventData*) |
指定したイベント識別子およびイベント データを使用して、WriteEvent の新しいオーバーロードを作成します。 |
WriteEventWithRelatedActivityId(Int32, Guid, Object[]) |
現在のアクティビティが別のアクティビティに関連していることを示すイベントを書き込みます。 |
WriteEventWithRelatedActivityIdCore(Int32, Guid*, Int32, EventSource+EventData*) |
現在のアクティビティが別のアクティビティに関連していることを示すイベントを書き込みます。 |
events
EventCommandExecuted |
コマンドのソースがイベント リスナーのときに発生します。 |
適用対象
スレッド セーフ
この型はスレッド セーフです。