none
How to working with svcTraceViewer ? RRS feed

  • Question

  • Hi

    I want to trace my wcf service which hosted on iis via svcTraceViewer tool (for .net 4.5). to do this, I've added this items to my wcf web.config file and start viewer, but nothing happened!!!

    Should I do something else ?

    thanks in advance


    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    Tuesday, July 7, 2015 10:17 PM

Answers

  • Ok, I will start creating an example.  Just to make sure, can you change the word "diagnostics" to "diagbroken" and verify you are editing the correct file.  Also, do you see any files (Error.svclog) being created in the physical location of your web application where this is running in IIS?  

    You mention looking in svctraceviewer.  This will not do anything unless you open a file.


    Jeff

    • Marked as answer by Hamed_1983 Wednesday, July 8, 2015 3:06 AM
    Wednesday, July 8, 2015 2:24 AM

All replies

  • Hello Hamed_1983,

    This should work so could you try the following?  Put a typo in the web.config in order to confirm that the you are editing the correct folder (apologies but this is common mistake).  Then check the eventviewer for any issues in application or system that might be related.  If still no good, then can you copy and past your diagnostics section here so we can look for the issue.

    Cheers



    Jeff

    Wednesday, July 8, 2015 12:26 AM
  • Thanks Jeff

    Where is correct foder?

    here is my web.config content :

    <?xml version="1.0"?>
    <configuration>
    
      <connectionStrings>
        <add name="PasmandConnectionString" connectionString="Data Source=.;Initial Catalog=MyDb;Persist Security Info=True;User ID=houshmand;Password=1"
          providerName="System.Data.SqlClient" />
      </connectionStrings>
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation targetFramework="4.5" />
        <httpRuntime targetFramework="4.5"/>
      </system.web>
      <system.serviceModel>
        <bindings>
        <basicHttpBinding>
          <binding maxReceivedMessageSize="10485760">
            <readerQuotas />
          </binding>
        </basicHttpBinding>
      </bindings>  
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true"/>
      </system.webServer>
    
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true" >
            <listeners>
              <add name="xml"/>
            </listeners>
          </source>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
              <add name="xml"/>
            </listeners>
          </source>
          <source name="myUserTraceSource"
                  switchValue="Information, ActivityTracing">
            <listeners>
              <add name="xml"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
          <add name="xml"
               type="System.Diagnostics.XmlWriterTraceListener"
               initializeData="Error.svclog" />
        </sharedListeners>
      </system.diagnostics>
    
    </configuration>
    

    Where is the problem ?


    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    Wednesday, July 8, 2015 1:21 AM
  • hello,

    The file I was referring to was the web.config that is in the folder IIS is using as the physical folder.

    In the web.config, please add the following to the <system.serviceModel> element:

    <diagnostics>
    <messageLogging maxMessagesToLog=”100" logEntireMessage=”true” logMessagesAtServiceLevel=”true” logMalformedMessages=”true” logMessagesAtTransportLevel=”true”>
    </messageLogging>
    </diagnostics>

    It does not really matter where; for example you can add before the end tag after the serviceHostingEnviroment element.


    Jeff

    Wednesday, July 8, 2015 1:42 AM
  • Here is some explanation: https://msdn.microsoft.com/en-us/library/ms731308%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396


    Jeff

    Wednesday, July 8, 2015 1:42 AM
  • I've added this code inside system.serviceModel element (as you told)

    <diagnostics>
          <messageLogging maxMessagesToLog="100" logEntireMessage="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logMessagesAtTransportLevel="true">
          </messageLogging>
        </diagnostics>

    Then restart svcTraceViewer, but nothing happened!

    would you plz give me a full web.config file content and step by step guidance to accomplish this task?

    thanks in advance


    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    Wednesday, July 8, 2015 2:13 AM
  • Ok, I will start creating an example.  Just to make sure, can you change the word "diagnostics" to "diagbroken" and verify you are editing the correct file.  Also, do you see any files (Error.svclog) being created in the physical location of your web application where this is running in IIS?  

    You mention looking in svctraceviewer.  This will not do anything unless you open a file.


    Jeff

    • Marked as answer by Hamed_1983 Wednesday, July 8, 2015 3:06 AM
    Wednesday, July 8, 2015 2:24 AM
  • when I try change "disgnostics" to "diagbroken", visual studio give me an error notification which this is not valid element.

    The "Error.svclog" is created in my webApp folder.


    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    Wednesday, July 8, 2015 2:33 AM
  • Excellent news.  What happens when you try to open the file with svctraceviewer?  Do you receive an error?

    Jeff

    Wednesday, July 8, 2015 2:35 AM
  • When I double click on the file, the svcTraceViewer being open!

    But when I view my web app via explorer, nothing happened!


    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx


    • Edited by Hamed_1983 Wednesday, July 8, 2015 2:39 AM
    Wednesday, July 8, 2015 2:39 AM