Share via


EventLogTraceListener.TraceEvent 메서드

정의

이벤트 로그에 이벤트 추적 정보를 씁니다.

오버로드

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

추적 정보, 메시지 및 이벤트 정보를 이벤트 로그에 씁니다.

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])

추적 정보, 형식 지정된 개체 배열 및 이벤트 정보를 이벤트 로그에 씁니다.

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Source:
EventLogTraceListener.cs
Source:
EventLogTraceListener.cs
Source:
EventLogTraceListener.cs

추적 정보, 메시지 및 이벤트 정보를 이벤트 로그에 씁니다.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType severity, int id, System::String ^ message);
[System.Runtime.InteropServices.ComVisible(false)]
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, string message);
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.TraceEvent : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string -> unit
Public Overrides Sub TraceEvent (eventCache As TraceEventCache, source As String, severity As TraceEventType, id As Integer, message As String)

매개 변수

eventCache
TraceEventCache

현재 프로세스 ID, 스레드 ID 및 스택 추적 정보가 포함된 개체입니다.

source
String

출력을 식별하는 데 사용되는 이름이며 일반적으로 추적 이벤트를 생성한 애플리케이션의 이름입니다.

severity
TraceEventType

추적이 발생한 이벤트의 형식을 지정하는 열거형 값 중 하나입니다.

id
Int32

이벤트의 숫자 식별자입니다. sourceid의 조합은 이벤트를 고유하게 식별합니다.

message
String

추적 메시지입니다.

특성

예외

source을(를) 지정하지 않았습니다.

또는

로그 엔트리 문자열이 32,766자를 초과합니다.

설명

중요

TraceEvent 메서드는 애플리케이션 코드에서 호출할 수 없습니다. 이러한 메서드는 추적 데이터를 쓰기 위해 , TraceTraceSource 클래스의 Debug메서드에 의해 호출됩니다.

메서드는 TraceEvent 도구에서 자동으로 처리할 수 있는 이벤트를 추적하기 위한 것입니다. 예를 들어 특정 이벤트가 특정 원본에 의해 추적되는 경우 모니터링 도구가 관리자에게 알릴 수 있습니다.

eventCachesource 매개 변수는 이벤트를 추적해야 하는지 여부를 결정하는 데 사용됩니다. id는 개체를 EventInstance 만드는 데 사용되며 는 TraceEventType 속성에 대한 EntryTypeEventLogEntryType 동일합니다. 는 EventInstance 메서드를 사용하여 데이터와 함께 message 이벤트 로그에 기록됩니다 WriteEvent .

참고

매개 변수의 id 최대값은 65,535입니다. 지정된 값이 id 65,535보다 크면 최대 값이 사용됩니다.

적용 대상

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])

Source:
EventLogTraceListener.cs
Source:
EventLogTraceListener.cs
Source:
EventLogTraceListener.cs

추적 정보, 형식 지정된 개체 배열 및 이벤트 정보를 이벤트 로그에 씁니다.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType severity, int id, System::String ^ format, ... cli::array <System::Object ^> ^ args);
[System.Runtime.InteropServices.ComVisible(false)]
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, string format, params object[] args);
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.TraceEvent : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string * obj[] -> unit
Public Overrides Sub TraceEvent (eventCache As TraceEventCache, source As String, severity As TraceEventType, id As Integer, format As String, ParamArray args As Object())

매개 변수

eventCache
TraceEventCache

현재 프로세스 ID, 스레드 ID 및 스택 추적 정보가 포함된 개체입니다.

source
String

출력을 식별하는 데 사용되는 이름이며 일반적으로 추적 이벤트를 생성한 애플리케이션의 이름입니다.

severity
TraceEventType

추적이 발생한 이벤트의 형식을 지정하는 열거형 값 중 하나입니다.

id
Int32

이벤트의 숫자 식별자입니다. sourceid의 조합은 이벤트를 고유하게 식별합니다.

format
String

args 배열에 들어 있는 개체에 해당하는 0개 이상의 형식 항목이 포함된 형식 문자열입니다.

args
Object[]

형식을 지정할 개체가 0개 이상 포함된 object 배열입니다.

특성

예외

source을(를) 지정하지 않았습니다.

또는

로그 엔트리 문자열이 32,766자를 초과합니다.

설명

중요

TraceEvent 메서드는 애플리케이션 코드에서 호출할 수 없습니다. 이러한 메서드는 추적 데이터를 쓰기 위해 , TraceTraceSource 클래스의 Debug메서드에 의해 호출됩니다.

메서드는 TraceEvent 도구에서 자동으로 처리할 수 있는 이벤트를 추적하기 위한 것입니다. 예를 들어 특정 이벤트가 특정 원본에 의해 추적되는 경우 모니터링 도구가 관리자에게 알릴 수 있습니다.

eventCachesource 매개 변수는 이벤트를 추적해야 하는지 여부를 결정하는 데 사용됩니다. id는 개체를 EventInstance 만드는 데 사용되며 는 TraceEventType 속성에 대한 EntryTypeEventLogEntryType 동일합니다. 는 EventInstanceargs 매개 변수에서 가져온 메시지와 함께 메서드를 사용하여 WriteEvent 이벤트 로그에 format 기록됩니다. 개체 배열은 args 메서드를 사용하여 Format 문자열로 변환되어 문자열과 args 배열을 format 전달하여 문자열을 이벤트 로그의 메시지로 서식을 지정합니다.

참고

매개 변수의 id 최대값은 65,535입니다. 지정된 값이 id 65,535보다 크면 최대 값이 사용됩니다.

적용 대상