C# Class Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener

Listener that routes all tracing and debugging output to ApplicationInsights logging framework. The messages will be uploaded to the Application Insights cloud service.
Inheritance: System.Diagnostics.TraceListener
Afficher le fichier Open project: Microsoft/ApplicationInsights-dotnet-logging

Private Properties

Свойство Type Description
CreateTraceData void
GetSeverityLevel SeverityLevel

Méthodes publiques

Méthode Description
ApplicationInsightsTraceListener ( ) : System

Initializes a new instance of the ApplicationInsightsTraceListener class, without specifying a component ID.

ApplicationInsightsTraceListener ( string instrumentationKey ) : System

Initializes a new instance of the ApplicationInsightsTraceListener class, and validates the component id passed as the initialize-data. An empty or null Component ID is acceptable because the event source will fall back to the one set in ApplicationInsights.config, however an invalid Component ID will throw an exception.

TraceData ( TraceEventCache eventCache, string source, TraceEventType eventType, int id ) : void

Writes trace data to the listener specific output.

TraceData ( TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data ) : void

Writes trace data to the listener specific output.

TraceEvent ( TraceEventCache eventCache, string source, TraceEventType eventType, int id ) : void

Writes trace information, a message, and event information to the listener specific output.

TraceEvent ( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format ) : void

Writes trace information, a message, and event information to the listener specific output.

Write ( string message ) : void

Writes the specified message to the listener.

WriteLine ( string message ) : void

Writes the specified message to the listener followed by a line terminator.

Private Methods

Méthode Description
CreateTraceData ( TraceEventCache eventCache, TraceEventType eventType, int id, Microsoft.ApplicationInsights.DataContracts.TraceTelemetry trace ) : void
GetSeverityLevel ( TraceEventType eventType ) : SeverityLevel

Method Details

ApplicationInsightsTraceListener() public méthode

Initializes a new instance of the ApplicationInsightsTraceListener class, without specifying a component ID.
public ApplicationInsightsTraceListener ( ) : System
Résultat System

ApplicationInsightsTraceListener() public méthode

Initializes a new instance of the ApplicationInsightsTraceListener class, and validates the component id passed as the initialize-data. An empty or null Component ID is acceptable because the event source will fall back to the one set in ApplicationInsights.config, however an invalid Component ID will throw an exception.
public ApplicationInsightsTraceListener ( string instrumentationKey ) : System
instrumentationKey string Instrumentation Key of your application.
Résultat System

TraceData() public méthode

Writes trace data to the listener specific output.
public TraceData ( TraceEventCache eventCache, string source, TraceEventType eventType, int id ) : void
eventCache System.Diagnostics.TraceEventCache A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.
source string A name used to identify the output, typically the name of the application that generated the trace event.
eventType TraceEventType One of the TraceEventType values specifying the type of event that has caused the trace.
id int A numeric identifier for the event.
Résultat void

TraceData() public méthode

Writes trace data to the listener specific output.
public TraceData ( TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data ) : void
eventCache System.Diagnostics.TraceEventCache A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.
source string A name used to identify the output, typically the name of the application that generated the trace event.
eventType TraceEventType One of the TraceEventType values specifying the type of event that has caused the trace.
id int A numeric identifier for the event.
data object The trace data to emit.
Résultat void

TraceEvent() public méthode

Writes trace information, a message, and event information to the listener specific output.
public TraceEvent ( TraceEventCache eventCache, string source, TraceEventType eventType, int id ) : void
eventCache System.Diagnostics.TraceEventCache A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.
source string A name used to identify the output, typically the name of the application that generated the trace event.
eventType TraceEventType One of the TraceEventType values specifying the type of event that has caused the trace.
id int A numeric identifier for the event.
Résultat void

TraceEvent() public méthode

Writes trace information, a message, and event information to the listener specific output.
public TraceEvent ( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format ) : void
eventCache System.Diagnostics.TraceEventCache A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.
source string A name used to identify the output, typically the name of the application that generated the trace event.
eventType TraceEventType One of the TraceEventType values specifying the type of event that has caused the trace.
id int A numeric identifier for the event.
format string A format string that contains zero or more format items, which correspond to objects in the args array.
Résultat void

Write() public méthode

Writes the specified message to the listener.
public Write ( string message ) : void
message string A message to write.
Résultat void

WriteLine() public méthode

Writes the specified message to the listener followed by a line terminator.
public WriteLine ( string message ) : void
message string A message to write.
Résultat void