FileLogTraceListener.TraceEvent Method (TraceEventCache, String, TraceEventType, Int32, String)

 

Writes trace information, a message and event information to the output file or stream.

Namespace:   Microsoft.VisualBasic.Logging
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true)]
public override void TraceEvent(
	TraceEventCache eventCache,
	string source,
	TraceEventType eventType,
	int id,
	string message
)

Parameters

eventCache
Type: System.Diagnostics.TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source
Type: System.String

A name of the trace source that invoked this method.

eventType
Type: System.Diagnostics.TraceEventType

One of the TraceEventType enumeration values.

id
Type: System.Int32

A numeric identifier for the event.

message
Type: System.String

A message to write.

This method:

  1. Formats the data and context information for output.

  2. Creates a new log file, if necessary.

  3. Writes the information to the log file.

For more information on creating new log files, see FullLogFileName.

This table lists the output fields in the order in which they appear. The fields are delimited by the string that the Delimiter property specifies, and are followed by a line terminator.

Field

Output condition

Description

source

Always.

The value of name.

severity

Always.

The enumeration-value name of eventType.

id

Always.

The string representation of id.

message

Always.

The value of message.

callStack

When the Callstack flag is set in the TraceOutputOptions property.

The Callstack property of eventCache.

CorrelationID

When the LogicalOperationStack flag is set in the TraceOutputOptions property.

The ThreadId property of eventCache.

DateTime

When the DateTime flag is set in the TraceOutputOptions property.

The string representation of the DateTime property of eventCache. The invariant culture is used for the string conversion.

ProcessID

When the ProcessId flag is set in the TraceOutputOptions property.

The string representation of the ProcessId property of eventCache. The invariant culture is used for the string conversion.

ThreadID

When the ThreadId flag is set in the TraceOutputOptions property.

The ThreadId property of eventCache.

Timestamp

When the Timestamp flag is set in the TraceOutputOptions property.

The string representation of the Timestamp property of eventCache. The invariant culture is used for the string conversion.

HostName

When the IncludeHostName property is True.

The name of the computer.

.NET Framework
Available since 2.0
Return to top
Show: