views:

45

answers:

1

I have a client (a Unit Test) that call to WCF Service (hosting in debug mode in Console application).

I have an error in service but I dont know which. I need trace it, but not generate anything file svclog in client.

any suggestions , any sample code works ?

EDIT: I use logging EntLibrary 4.1. I think there are errors in configuration and WCF diagnostics Tracing not trace logs.

My config in Client is:

  <system.diagnostics configSource="Config\diagnostics.config" />

  <system.serviceModel>
    <behaviors configSource="Config\system.servicemodel.behaviors.config" />
    <bindings configSource="Config\system.servicemodel.bindings.config" />
    <client configSource="Config\system.servicemodel.client.config" />

    <diagnostics wmiProviderEnabled="false">
      <messageLogging logEntireMessage="true"
                logMalformedMessages="true"
                logMessagesAtServiceLevel="true"
                logMessagesAtTransportLevel="true"
               />

    </diagnostics>

  </system.serviceModel>


<system.diagnostics>
  <sources>
    <source name="System.ServiceModel" switchValue="Warning" propagateActivity="true" >
      <listeners>
        <add name="xml"/>
      </listeners>
    </source>

    <source name="myUserTraceSource" switchValue="Warning, ActivityTracing">
      <listeners>
        <add name="xml"/>
      </listeners>
    </source>
  </sources>

  <sharedListeners>
    <add name="xml"
         type="System.Diagnostics.XmlWriterTraceListener"
         initializeData="TraceLog.svclog" />
  </sharedListeners>

</system.diagnostics>

  <loggingConfiguration configSource="Config\loggingConfiguration.config"/>

  <exceptionHandling configSource="Config\exceptionHandling.config" />
+1  A: 

You may want to set your switchValue's to All -- that will log everything. (See table 2/3 down page here.)

If you're error is on your server, add your <diagnostics> element to your server's web.config file instead of your client's web.config file. If the error is on your server, then you need to trace it there. I would think if your service is erroring out, then tracing on the client won't give you as much information as tracing on the server side.

If you could provide more information about the error that you're seeing, that would also help. I'll update my answer accordingly.

Hope this helps!

David Hoerster
Add diagnostics section in server but not trace. I think the problem is logging configuration Ent Library that fails, but WCF Diagnostics Tracing not trace anything
alhambraeidos