locked
Disable Tracing at Runtime RRS feed

  • Question

  • I am enabling tracing on System.Net source with Information source switch using approach described at How to: Configure Network Tracing.

    However, after enabling the tracing I receive 15% noise in CPU.

    I would like to disable the trace when CPU reaches specific threshold.

    I am wondering is it possible to disable tracing on System.Net at runtime and if it is possible, how to do this?



    Mihail Smacinih

    Wednesday, May 7, 2014 11:21 PM

Answers

  • Jack, thanks for your answer!
    I believe I found the solution to my problem, it is explained here.

    Unfortunately this is not documented and not exposed API for turning off the System.Net tracing, but it works at least in my prototype.


    Mihail Smacinih

    Friday, May 9, 2014 6:40 PM

All replies

  • Hi Mihail,

    Thank you for posting in the MSDN forum.

    Actually I‘m not very sure that whether it is the debugger issue since this forum is to discuss the VS Debugger tool.

    But I did some research about this issue, maybe you could get useful information.

    Like this document “Configuring Tracing”:

    Tracing is not enabled by default. To activate tracing, you must create a trace listener and set a trace level other than "Off" for the selected trace source in configuration; otherwise, WCF does not generate any traces. If you do not specify a listener, tracing is automatically disabled. If a listener is defined, but no level is specified, the level is set to "Off" by default, which means that no trace is emitted.

    So it seems that we could control the level to enable/disable different trace message.

    I also found two cases about the similar issue, if possible, you could refer them:

    Turning trace on and off + specifying filepath at runtime

    Turning tracing off via app.config

    Hope it could help, if there's any concern, please feel free to let me know.

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 8, 2014 7:06 AM
  • Jack, thanks for your answer!
    I believe I found the solution to my problem, it is explained here.

    Unfortunately this is not documented and not exposed API for turning off the System.Net tracing, but it works at least in my prototype.


    Mihail Smacinih

    Friday, May 9, 2014 6:40 PM