System.Web.TraceContext.Warn Method

Writes trace information to the trace log, including any user-defined categories, trace messages, and error information. All warnings appear in the log as red text.

Syntax

public void Warn (string category, string msg, Exception error)

Parameters

msg
a string
error
a Exception
category
The trace category that receives the message.

Remarks

Every time the erload:System.Web.TraceContext.Warn method is called, a System.Web.TraceContext trace message is added to the TraceContextEventArgs.TraceRecords messages collection, which is accessible when you handle the TraceContext.TraceFinished event. The message is added with its TraceContextRecord.IsWarning property set to true, and the TraceContextRecord.ErrorInfo property is set to the object passed by the errorInfo parameter.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0