Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileLogTraceListener::TraceData Method (TraceEventCache^, String^, TraceEventType, Int32, array<Object^>^)

 

Writes trace information, an array of data objects, and event information to the output file or stream.

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

public:
[HostProtectionAttribute(SecurityAction::LinkDemand, Synchronization = true)]
virtual void TraceData(
	TraceEventCache^ eventCache,
	String^ source,
	TraceEventType eventType,
	int id,
	... array<Object^>^ data
) override

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^

The 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.

data
Type: array<System::Object^>^

An array of objects to emit as data.

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 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 string consisting of the string representation of each element in data, each separated by Delimiter.

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: