3
Reply

How to enable tracing in Web API?

Suresh Kumar

Suresh Kumar

7y
5.8k
2
Reply

    To enable tracing place below code in –“Register” method of WebAPIConfig.cs file.config.EnableSystemDiagnosticsTracing();

    Tracing can be enabled using below line:
    public static void Register(HttpConfiguration config)
    {
    config.EnableSystemDiagnosticsTracing();
    }

    But if you want to write your own tracer, you can inherit ITraceWriter and provide your implementation.

    in “Register” method of WebAPIConfig.cs place the code file.config.EnableSystemDiagnosticsTracing();