Share via


SystemDiagnosticsTraceWriter.Trace Method

Writes a trace to Trace if the level is greater than or equal MinimumLevel.

Namespace:  System.Web.Http.Tracing
Assembly:  System.Web.Http.Tracing (in System.Web.Http.Tracing.dll)

Syntax

'Declaration
Public Overridable Sub Trace ( _
    request As HttpRequestMessage, _
    category As String, _
    level As TraceLevel, _
    traceAction As Action(Of TraceRecord) _
)
'Usage
Dim instance As SystemDiagnosticsTraceWriter 
Dim request As HttpRequestMessage 
Dim category As String 
Dim level As TraceLevel 
Dim traceAction As Action(Of TraceRecord)

instance.Trace(request, category, level, _
    traceAction)
public virtual void Trace(
    HttpRequestMessage request,
    string category,
    TraceLevel level,
    Action<TraceRecord> traceAction
)
public:
virtual void Trace(
    HttpRequestMessage^ request, 
    String^ category, 
    TraceLevel level, 
    Action<TraceRecord^>^ traceAction
)
abstract Trace : 
        request:HttpRequestMessage * 
        category:string * 
        level:TraceLevel * 
        traceAction:Action<TraceRecord> -> unit  
override Trace : 
        request:HttpRequestMessage * 
        category:string * 
        level:TraceLevel * 
        traceAction:Action<TraceRecord> -> unit
public function Trace(
    request : HttpRequestMessage, 
    category : String, 
    level : TraceLevel, 
    traceAction : Action<TraceRecord>
)

Parameters

  • request
    Type: HttpRequestMessage
    The HttpRequestMessage associated with this trace. It may be null but the resulting trace will contain no correlation ID.
  • category
    Type: System.String
    The category for the trace. This can be any user-defined value. It is not interpreted by this implementation but is written to the trace.

Implements

ITraceWriter.Trace(HttpRequestMessage, String, TraceLevel, Action<TraceRecord>)

See Also

Reference

SystemDiagnosticsTraceWriter Class

System.Web.Http.Tracing Namespace