TraceSource.TraceInformation Method

Definition

Writes an informational message to the trace listeners in the Listeners collection.

Overloads

TraceInformation(String)

Writes an informational message to the trace listeners in the Listeners collection using the specified message.

TraceInformation(String, Object[])

Writes an informational message to the trace listeners in the Listeners collection using the specified object array and formatting information.

TraceInformation(String)

Source:
TraceSource.cs
Source:
TraceSource.cs
Source:
TraceSource.cs

Writes an informational message to the trace listeners in the Listeners collection using the specified message.

C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string message);
C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string? message);

Parameters

message
String

The informative message to write.

Attributes

Exceptions

An attempt was made to trace an event during finalization.

Remarks

The TraceInformation method provides an informational message intended to be read by users and not by tools.

TraceInformation(String) calls the TraceEvent(TraceEventType, Int32, String) method, setting eventType to TraceEventType.Information and passing the informative message as the message string. The TraceEvent(TraceEventType, Int32, String) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String) method of each trace listener.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

TraceInformation(String, Object[])

Source:
TraceSource.cs
Source:
TraceSource.cs
Source:
TraceSource.cs

Writes an informational message to the trace listeners in the Listeners collection using the specified object array and formatting information.

C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string format, params object?[]? args);
C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string? format, params object?[]? args);
C#
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string format, params object[] args);

Parameters

format
String

A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array.

args
Object[]

An array containing zero or more objects to format.

Attributes

Exceptions

format is null.

format is invalid.

-or-

The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format.

An attempt was made to trace an event during finalization.

Remarks

For more information about the format parameter, see Composite Formatting.

The TraceInformation method provides an informational message intended to be read by users and not by tools.

TraceInformation(String, Object[]) calls the TraceEvent(TraceEventType, Int32, String, Object[]) method, setting eventType to TraceEventType.Information and passing the message content as an object array with formatting information. The TraceEvent(TraceEventType, Int32, String, Object[]) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[]) method of each trace listener.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1