none
Tracing Port Sharing Service (SMSvcHost.exe) RRS feed

  • Question

  • Hi,

    we are trying to trace the port sharing service in order to find a bottle neck in our application (huge load with many clients). Therefore we thought we can enable the WCF tracing in the port sharing service (SMSvcHost) with the following configuration:

    <?xml version="1.0" encoding="utf-8"?>
    <!-- The configuration file for SMSvcHost.exe -->
    <configuration>
        <runtime>
            <gcConcurrent enabled="false" />
        </runtime>
        <system.serviceModel>
            <!-- SMSvcHost ETW traces are redirected by default to an etwProviderId different from WCF's default. 
                 To trace to the default provider, remove the etwProviderId attribute below. -->
            <diagnostics performanceCounters="Off" etwProviderId="{f18839f5-27ff-4e66-bd2d-639b768cf18b}"/>
        </system.serviceModel>
    
        <!-- Below are some sample config settings:    
        <system.serviceModel.activation>
            <net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10" teredoEnabled="false">
                <allowAccounts>
                    // LocalSystem account
                    <add securityIdentifier="S-1-5-18"/>
    
                    // LocalService account
                    <add securityIdentifier="S-1-5-19"/>
                    
                    // Administrators account
                    <add securityIdentifier="S-1-5-20"/>
                    
                    // Network Service account
                    <add securityIdentifier="S-1-5-32-544" />
                    
                    // IIS_IUSRS account (Vista only)
                    <add securityIdentifier="S-1-5-32-568"/>
                </allowAccounts>
            </net.tcp>
            <net.pipe maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10">
                <allowAccounts>
                    // LocalSystem account
                    <add securityIdentifier="S-1-5-18"/>
    
                    // LocalService account
                    <add securityIdentifier="S-1-5-19"/>
                    
                    // Administrators account
                    <add securityIdentifier="S-1-5-20"/>
                    
                    // Network Service account
                    <add securityIdentifier="S-1-5-32-544" />
                    
                    // IIS_IUSRS account (Vista only)
                    <add securityIdentifier="S-1-5-32-568"/>
                </allowAccounts>
            </net.pipe>
            <diagnostics performanceCountersEnabled="true" />
        </system.serviceModel.activation>
        -->
    
     <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="D:\PortSharingTrace\Traces.svclog" />
      </sharedListeners>
     </system.diagnostics>
    
    
    	
    </configuration>
    

    But we do not see any logging output. Normally with starting the application, the log files will be created.

    Any ideas?

    Monday, September 28, 2015 8:05 AM

Answers

All replies

  • Hi Gnimor,

    According to this case, as we know that, by default WCF does not record any messages.

    To initiate message logging, we have to add a trace listener to the

    System.ServiceModel.MessageLogging trace source and set attributes for

    the messageLogging element in the configuration file. To permit logging and

    tracing, we have to insert and stipulate some extra options in the formation.

    May be you refer to this articles, that will explain that.

    Logging and Tracing WCF Soap Messages

    I hope that will be helpful to you.

    Best Regards,

    Grady

    Tuesday, September 29, 2015 3:14 AM
    Moderator
  • Hi Grady,

    thanks for your update - so I tried your suggestion but without success. I still do not see any logging output. Now my SMSvcHost.exe.config looks like:

    <?xml version="1.0" encoding="utf-8"?>
        <!-- The configuration file for SMSvcHost.exe -->
        <configuration>
            <runtime>
                <gcConcurrent enabled="false" />
            </runtime>
    
            <system.serviceModel>
                <diagnostics>
                    <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="true" maxMessagesToLog="2147483647" maxSizeOfMessageToLog="2147483647" />
                </diagnostics>
            </system.serviceModel>
             
            <system.diagnostics>
                <sources>
                    <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing" propagateActivity="true">
                    <listeners>
                        <add name="ServiceModelTraceListener">
                            <filter type="" />
                        </add>
                    </listeners>
                    </source>
                    <source name="System.ServiceModel.MessageLogging">
                    <listeners>
                        <add name="ServiceModelMessageLoggingListener">
                            <filter type="" />
                        </add>
                    </listeners>
                    </source>
                </sources>
                <sharedListeners>
                    <add initializeData="E:\WcfTrace\Tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
                        <filter type="" />
                    </add>
                    <add initializeData="E:\WcfTrace\Messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
                        <filter type="" />
                    </add>
                </sharedListeners>
                <trace autoflush="true" />
            </system.diagnostics>
    
    
    
            <!-- Below are some sample config settings:    
        <system.serviceModel.activation>
            <net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10" teredoEnabled="false">
                <allowAccounts>
                    // LocalSystem account
                    <add securityIdentifier="S-1-5-18"/>
    
                    // LocalService account
                    <add securityIdentifier="S-1-5-19"/>
                    
                    // Administrators account
                    <add securityIdentifier="S-1-5-20"/>
                    
                    // Network Service account
                    <add securityIdentifier="S-1-5-32-544" />
                    
                    // IIS_IUSRS account (Vista only)
                    <add securityIdentifier="S-1-5-32-568"/>
                </allowAccounts>
            </net.tcp>
            <net.pipe maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10">
                <allowAccounts>
                    // LocalSystem account
                    <add securityIdentifier="S-1-5-18"/>
    
                    // LocalService account
                    <add securityIdentifier="S-1-5-19"/>
                    
                    // Administrators account
                    <add securityIdentifier="S-1-5-20"/>
                    
                    // Network Service account
                    <add securityIdentifier="S-1-5-32-544" />
                    
                    // IIS_IUSRS account (Vista only)
                    <add securityIdentifier="S-1-5-32-568"/>
                </allowAccounts>
            </net.pipe>
            <diagnostics performanceCountersEnabled="true" />
        </system.serviceModel.activation>
        -->
        </configuration>

    Tuesday, September 29, 2015 7:02 AM
  • Hi Gnimor,

    If you used the SMSvcHost.exe may be you can refer to the following articles

    1.SMSvcHost.exe TRACE(NET TCP PORT SHARING SERVICE)

    2.Modifying SMSvcHost.exe.config for WCF

    I hope that will be helpful to you.

    Best Regards,

    Grady

    Wednesday, September 30, 2015 3:29 AM
    Moderator