none
WCF Tracing with DbgView RRS feed

  • Question

  • When calling System.Diagnostics.Trace.WriteLine() in my WCF services, I opened up DbgViewer but didn't see any outputs. I tried to modify Web.config with the following configuration:

    <system.diagnostics>
      <sources>
        <source name="System.ServiceModel"
                switchValue="Information, ActivityTracing"
                propagateActivity="true">
          <listeners>
            <add name="traceListener"
                type="System.Diagnostics.ConsoleTraceListener"/>
          </listeners>
        </source>
      </sources>
        </system.diagnostics>

    But it didn't help at all. I am wondering if there is anyway that would allow me to do real-time tracing (vs. writing a log file and opening it up when all calls are finished. In other words, SysTraceViewer or other XML-based tracing listeners wouldn't help me with my particular application). Thanks for your help in advance!


    lakeeast

    Tuesday, March 19, 2013 6:58 AM

Answers

  • Hi,

    Make sure you have set "compilation debug=true" in the web.config and please run the DebugView.exe with Administrator and try check Capture Global Win32 option on the Capture tab of the DebugView, and do not run the code through Visual Studio as it attaches its own debugger and DebugView is not able to catch the output then, you can try call a wcf service from a remote system.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by lakeeast Friday, March 22, 2013 2:59 AM
    Wednesday, March 20, 2013 6:04 AM
    Moderator

All replies

  • Hi,

    You can do it using the texttrace listiner like

    <listeners>
       
    <add name="logtextListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="MyText.log" />
       
    <add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener"/>
       
    </listeners>

    refer to the link for more info

    http://msdn.microsoft.com/en-us/library/system.diagnostics.textwritertracelistener.aspx

    Regards,

    stygen

    Tuesday, March 19, 2013 10:20 AM
  • I guess I didn't make my question clear...I am talking specifically about REAL-TIME TRACING with DebugViewer, not only just simple text-based tracing with things like TextWriterTraceListener. With the changes you proposed, I do have text-based log generated, but I am wondering how to redirect the outputs to the ConsoleTraceListener or its equivalent so I can monitor system outputs when my application is running.

    lakeeast

    Tuesday, March 19, 2013 12:20 PM
  • Hi,

    Make sure you have set "compilation debug=true" in the web.config and please run the DebugView.exe with Administrator and try check Capture Global Win32 option on the Capture tab of the DebugView, and do not run the code through Visual Studio as it attaches its own debugger and DebugView is not able to catch the output then, you can try call a wcf service from a remote system.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by lakeeast Friday, March 22, 2013 2:59 AM
    Wednesday, March 20, 2013 6:04 AM
    Moderator
  • Haixia,

    Thanks for your kind reply: your solution works for me!



    lakeeast

    Friday, March 22, 2013 2:59 AM