Cannot log to database when integrate with WCF

Topics: Logging Application Block
Apr 29, 2009 at 4:08 AM
Hello,

I have a WCF service hosted in IIS 5.  I have configured all steps required to integrate EL with WCF with category and listener as below

<

 

add switchValue="All" name="System.ServiceModel">

 

<

 

listeners>

 

<

 

add name="Database Trace Listener" />

 

<

 

add name="WCF XML Trace Listener" />

 

</

 

listeners>

 

</

 

add>

 

and

<

 

system.diagnostics>

 

<

 

sources>

 

<

 

source name="System.ServiceModel" switchValue="All">

 

<

 

listeners>

 

<

 

add name="WCFTraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,

 

Microsoft.Practices.EnterpriseLibrary.Logging

 

" />

 

</

 

listeners>

 

</

 

source>

 

</

 

sources>

 

</

 

system.diagnostics>

 


in my operation contract, I try to log a simple message like:

Logger

 

.Write("Message", "System.ServiceModel");

 

or

Logger

 

.Write("Message", "WCFTraceListener");

 

(I dont know which category name should I put in the second parameter)
But both haven't worked and haven't logged anything to database. BTW, the database was created by running the script, nothing changed.

I also have a WCF unit test that will launches a hosting app and a client app to consume that services provided by the hosting app. If I run a test method to test the same operation contract, It created continuosly a lot of rows which were error or information in the dbo.Log table. Even I stopped the unit test, It still created rows in that table unless I manually shut down the VSTest process.

Looking to the message logged in the row, it said that:
".....ErrorCode: -2146232060 Message: Cannot insert the value NULL into column 'Title', table 'Logging.dbo.Log'; column does not allow nulls. INSERT fails.  The statement has been terminated.  The 'WriteLog' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead..."

Any help would be highly appreciated.

Thanks!



Apr 29, 2009 at 9:46 AM
Hi,

The category that you should provide is the category that contains the Database Tracelistener. Looking at your provided config, I cant find the entry for the database trace listener. Can you post you full config file? 


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 29, 2009 at 2:44 PM
Edited Apr 29, 2009 at 9:43 PM

Hi Valiant,

Thanks for your help.

I wanted to post my whole web.config file but it seems too big and was not displayed correctly in the browser (?). I have defined the System.ServiceModel Category inside the <categorySource> section, and as you said, the use of Logger.Write("Message","System.ServiceModel"); should be fine, is it correct.
Anyway, I post here my whole loggingConfiguration section, hopefully it will be displayed well in the browser.

 <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="Services" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add databaseInstanceName="LoggingDB" writeLogStoredProcName="WriteLog"
        addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Database Trace Listener" />
      <add databaseInstanceName="LoggingDB" writeLogStoredProcName="WriteLog"
        addCategoryStoredProcName="AddCategory" formatter="EventLog Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="EvenLog Database Trace Listener" />
      <add fileName="C:\WCF_trace-xml_%CurrentDate%.log" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.XmlTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.XmlTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="WCF XML Trace Listener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="EventLog Text Formatter" />
      <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="Business">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="DAL">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="Services">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="System.ServiceModel">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category" />
      <errors switchValue="Error" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="EvenLog Database Trace Listener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>

 

 

Apr 29, 2009 at 8:44 PM
I have realized that if I put this section into my web.config
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Information">
        <listeners>
          <add name="WCFTraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,Microsoft.Practices.EnterpriseLibrary.Logging" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

and turn on the Error in specialSources section
<errors switchValue="Error" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="EvenLog Database Trace Listener" />
        </listeners>
</errors>

then start consuming that service, it then starts logging a lot of errors into dbo.Log table. Those errors always start with
'Tracing to LogSource 'System.ServiceModel' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks."

Do you think that there should be something wrong in my configuration?
Apr 30, 2009 at 4:17 AM
Do you previously have that section before in your app? 'Coz it's one of the required steps when integrating logging with wcf.  If you do have that before, I actually can't see anything wrong with your config
currently but if you could send me your config, I could have a better look.  Could you also try to change the switchValue to "All" instead of "Information" in your system.diagnostics section and see what happens.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 30, 2009 at 4:52 AM

Hi Sarah,

Thanks for your helping.

Yes, that section was in my app before and I continuously got error rows logged into dbo.Log table.

If I decided to take out that section, (and ofcourse it's not a proper way to log in WCF since WCF cannot directly transfer any events to LAB, as I understand), but the Logger.Write("Message","System.ServiceModel") did does its job to write to dbo.Log table with category "System.ServiceModel".

If I put the swith to "Information" in that section and turn off the Error section in specialSources section, it didn't log any error row to dbo.Log table, but I still felt a slow-down time when consuming the WCF operation constract and I guess it still emit the error events but not log them to dbo.Log table.

Here is all my web.config file:

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="Services" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add databaseInstanceName="LoggingDB" writeLogStoredProcName="WriteLog"
        addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Database Trace Listener" />
      <add databaseInstanceName="LoggingDB" writeLogStoredProcName="WriteLog"
        addCategoryStoredProcName="AddCategory" formatter="EventLog Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="EvenLog Database Trace Listener" />
      <add fileName="C:\WCF_trace-xml.log" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.XmlTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.XmlTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="WCF XML Trace Listener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="EventLog Text Formatter" />
      <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="Business">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="DAL">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="Services">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="System.ServiceModel">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category" />
      <errors switchValue="Error" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="EvenLog Database Trace Listener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>
  <connectionStrings>
    <add name="Dev" connectionString="Data Source=MyServer;Initial Catalog=dbS2K_WBOE;Uid=admin;Pwd=1234;"
      providerName="System.Data.SqlClient" />
    <add name="LoggingDB" connectionString="Data Source=MyServer;Initial Catalog=Logging;Uid=admin;Pwd=1234;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
    <compilation debug="false">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
    <authentication mode="Windows" />
    <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </controls>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
    </compilers>
  </system.codedom>
  <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="MyServicesBehavior" name="MyService">
        <endpoint address="" binding="wsHttpBinding" name="PatientService" contract="IPatientService" />
        <endpoint address="mex" binding="mexHttpBinding" name="MEXPatientService" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/MyServices" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyservicesBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="All">
        <listeners>
          <add name="WCFTraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,Microsoft.Practices.EnterpriseLibrary.Logging" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>

Apr 30, 2009 at 5:50 AM
I was able to repro your case.  However, I believe you still get the log in your database, it's possible you weren't just able to see it because of the numerous entries that get logged.  That was the case on my end.  I got a lot of log entries in my event viewer and was unable to locate the one which I specified in my Logger.Write method so my initial impression was it didn't get to logged at all.  After doing some more tests,  I was finally able to locate it by specifying my message as of type Error.  It just got lost in the bulk of Information logs.  Could you verify if this is what happens on your end?  I'll try in the meantime to investigate what do we need to do to turn off those logs.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 30, 2009 at 1:45 PM

Hi Sarah,

Thank you very much for your helping.

I don't quite understand your situation but getting a bulk of logs when consuming WCF with the configuration above is my case. However, 70% of them are error type, and the rest are information. The logged message for error type always likes:
'Tracing to LogSource 'System.ServiceModel' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks."

I think you already reproduced my case, could you please investigate it more? I'm likely banging my head to the wall.

Thanks

May 4, 2009 at 8:05 AM

Yes, I was able to repro it now.  However, I need to clarify from you if you're still not seeing those logs which are results of the Logger.Write statements because in my case, it was being logged to the database.  Try to change the tracelistener for the Logging Errors and Warnings to a FormattedEventLog TraceListener and set the Filter to Error.  Have you Database Trace Listener's Filter set to information verify that the Logger.Write statement works.  I'm still trying to figure out where those error logs are coming from.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

 

May 4, 2009 at 6:15 PM
Hi Sarah,

I dont think it is because of Logger.Write. Whenever I put this piece of config:
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="All">
        <listeners>
          <add name="WCFTraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,Microsoft.Practices.EnterpriseLibrary.Logging" />
        </listeners>
      </source>
    </sources>
</system.diagnostics>

Then the service started emitting errors and transfered them to the section
<specialSources>
      <errors switchValue="Error" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </errors>
</specialSources>

Then all those errors were logged into dbo.Log table.

All errors are the same:
"Tracing to LogSource 'System.ServiceModel' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.   Summary for Enterprise Library Distributor Service: ====================================== -->   Message:   Timestamp: 5/4/2009 4:51:51 PM  Message:   Category: System.ServiceModel  Priority: 2147483647  EventId: 0  Severity: Transfer  Title:  Machine: AGL38A8P2  App Domain: /LM/w3svc/1/ROOT/S2KTest/WBOEServices-7-128859293840495816  ProcessId: 6076  Process Name: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_wp.exe  Thread Name:   Win32 ThreadId:6584  Extended Properties: TraceEventCache - System.Diagnostics.TraceEventCache   --> MachineName: AGL38A8P2 --> TimeStamp: 5/4/2009 4:51:51 PM --> FullName: Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 --> AppDomainName: /LM/w3svc/1/ROOT/S2KTest/WBOEServices-7-128859293840495816 --> WindowsIdentity: AGL38A8P2\ASPNET  Exception Information Details: ====================================== Exception Type: System.NotImplementedException Message: The method or operation is not implemented. Data: System.Collections.ListDictionaryInternal TargetSite: Void Write(System.String) HelpLink: NULL Source: ARUP.S2K.Logging  StackTrace Information Details:  ====================="

The call Logger.Write still log the message after all.

How can I get rid of those erros when put back the System.Dianostic section in the web.config file?

Thank you.
May 5, 2009 at 12:19 PM
Hi,

I'm not that familiar with this feature of Ent Lib, but as far as I've debugged, here's what I've found out. The errors that was being logged to the database is because of the error that you posted on your initial post. Someone is inserting a null value to the Database then It throws an exception. I checked the EntLibLoggingProxyTraceListener code and it seems that it is the one responsible for assigning null value to the title of the logEntry, but in other case that might work for other tracelisteners which allows even null values(ex. Formatted Event Log TraceListener). That's why the message says that Tracing to LogSource 'System.ServiceModel' failed. A workaround for this is to 'allow null' to be inserted on column 'Title' of dbo.Log table. I have tried it and it works fine for me. 


Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
May 6, 2009 at 8:48 PM
Edited May 6, 2009 at 8:58 PM

You are rigth Valiant. If I allow title to be nullable, it works fine, but as long as I set the switch value to "All", not "Error" only

<add switchValue="All" name="System.ServiceModel">
        <listeners>
          <add name="Custom Database Trace Listener" />
        </listeners>
      </add>

The <system.diagnostics> keeps sending all messages including "information" and "verbose" type (I meant severity) to the sestion above, it then logs those messages to the database. it significantly slows dow the performance.
So, question: Do we really need to follow the steps guided to integrate logging with WCF if we dont need that information? or even errors happen at WCF layer if we have exception handling block, which includes logging, used to catch those errors?
If I dont follow the guidance, any side affect on WCF layer, on logging?

May 7, 2009 at 8:44 AM
Hi,

I tried setting the switchvalue to "Error" and as a result it only logs is of type error, any other types are not logged in the database. I can send you my sample solution if you like.
Just send us your email address.

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
May 8, 2009 at 3:58 AM

Yes, If I put "Error" in the switchValue, it works fine. But seems it's recommended by default that we should put "All" in that switch, and then it would log a lot of information and verbose message type to database. For example, one of them look like:

<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.AppDomainUnload.aspx</TraceIdentifier><Description>AppDomain unloading.</Description><AppDomain>/LM/w3svc/1/ROOT/MyServices-1-128861097480447970</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><AppDomain.FriendlyName>/LM/w3svc/1/ROOT/MyServices-1-128861097480447970</AppDomain.FriendlyName><ProcessName>aspnet_wp</ProcessName><ProcessId>4108</ProcessId></ExtendedData></TraceRecord>

 

why those information were continuously logged into the database? and why a lot? I dont need those information, how can I get rid of them? (I dont want to set the switchValue to "Error" agian)

May 8, 2009 at 7:14 AM

So you just want to get rid of those logs that came from WCF, try setting the switchValue="Error" of the source inside the <system.diagnostics> that you've added.  

<system.diagnostics>

    <sources>

      <source name="System.ServiceModel" switchValue="Error">

        <listeners>

          <add type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,

Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

            name="WCFTraceListener">

          </add>

        </listeners>

      </source>

    </sources>

  </system.diagnostics>

 

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

 

 

 

May 8, 2009 at 2:44 PM

Hi Valiant,

Thanks all for your time to trace my problem. I'm still confusing why that kind of infomation/versobe messages continuously emitted and logged into database. It definitely affects the performance. Now I have to set the filter "Error" to log only errors message. I will try to make an exception at WCF layer to see how many error messages will be generated and loogged into database. If there will be a lot and affect the perfomance of the application, I think Enterprise Library team need to look back this problem.

May 11, 2009 at 7:00 AM
Edited May 11, 2009 at 7:03 AM

I think those info/verbose messages are part of WCF tracing. For now setting the switchValue will somehow do the trick.

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Dec 1, 2009 at 1:42 PM

Valiant,

I am having a similar problem in my app. I have a WCF service and I have put 

EntLibLoggingProxyTraceListener in the System.Diagonistic Node in my config file. Whenever the Client sends a message thru the transport layer the WCF message gets routed to the Flatfile listner in the  configured in the Entlib logging application section. However I have a second listner writing to the database and it wont write any thing to the Log Database. I have the Database created based on entlib batchfile . Do I have to write code Logger.Write in my code? whjen the message is logged to the flatfile, should not it write to the DB as well? Do I have to create a format file.

Dec 2, 2009 at 12:00 AM

Does that databasetracelistener be included in the category where the flatfiletracelistener is? It should be.  If this is true for your case, I suggest you run a sql profiler and see if there were any insert sql statements against the Log table of the Logging Database.  Also check the destination log of the trace listener you configured under the Logging Errors and Warnings node for any error logs indicating why logging to database failed.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Dec 2, 2009 at 7:01 PM

Thanks Sarah for your reply. The Database tracelistner is included and when I ran the profiler I don't see any insert statements against Log database. Can I troubleshoot why it's failing. For your reference Please find the entire app.config file. The Flat file gets created fine.

 

<?xml version="1.0" encoding="utf-8" ?>


<configuration>

  <configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </configSections>

  <loggingConfiguration name="Logging Application Block"
                        tracingEnabled="true"
                    defaultCategory="System.ServiceModel.MessageLogging"
                        logWarningsWhenNoCategoriesMatch="true"   >
    <listeners>
      <add databaseInstanceName="LoggingconnectionString" writeLogStoredProcName="WriteLog"
        addCategoryStoredProcName="AddCategory" formatter="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Database Trace Listener" />
      <add fileName="trace-xml.log"
                listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.XmlTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                traceOutputOptions="None"  type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.XmlTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="XML Trace Listener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp}Message: {message}Category: {category}Priority: {priority}EventId: {eventid}Severity: {severity}Title:{title}Machine: {machine}Application Domain: {appDomain}Process Id: {processId}Process Name: {processName}Win32 Thread Id: {win32ThreadId}Thread Name: {threadName}Extended Properties: {dictionary({key} - {value})}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="EventLog Text Formatter" />
      <add template="Timestamp: {timestamp}Message: {message}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="XML Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category" />
      <errors switchValue="All" name="Logging Errors &amp; Warnings" />
    </specialSources>
  </loggingConfiguration>

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelMessageLoggingListener">
            <filter type="" />
          </add>
          <add name="traceListener"
         type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,
                     Microsoft.Practices.EnterpriseLibrary.Logging">
            <filter type="" />
          </add>
        </listeners>
      </source>
      <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing"
        propagateActivity="false">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelTraceListener">
            <filter type="" />
          </add>
          <add name="traceListener"
          type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,
                     Microsoft.Practices.EnterpriseLibrary.Logging">
            <filter type="" />
           
          </add>

        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="App_messages.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
      <add initializeData="App_tracelog.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>
  <system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
    </diagnostics>
    <bindings>
   
      <netMsmqBinding>
        <binding name="netMsmqWindowsBinding" maxReceivedMessageSize="2147483647"  >
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
              maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None" >
            <transport msmqProtectionLevel="None" msmqAuthenticationMode="None"/>
          </security>
        
        </binding>
      </netMsmqBinding>
    </bindings>
    <client>
      <endpoint binding="netMsmqBinding" bindingConfiguration="netMsmqWindowsBinding"
          contract="IService"
      address="net.msmq://localhost/private/Queue"
          name="netMsmqWindowsBinding">
    
      </endpoint>
    </client>
  </system.serviceModel>
 
 
  <connectionStrings>
    <add name="LoggingconnectionString" connectionString="Data Source=localhost;Initial Catalog=Logging;Persist Security Info=True;User ID=UID;Password=****"
     providerName="System.Data.SqlClient" />
    <add name="APPconnectionString"
   connectionString="Data Source=localhost;Initial Catalog=AppDatabse;Persist Security Info=True;User ID=UID;Password=****"
   providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
   
  </appSettings>
</configuration>

Dec 3, 2009 at 12:48 AM

Hi,

Looking at your config, it seems that you have 2 category with different trace listener for each. They also have the same name. I tried opening this in the config tool and prompt me errors. I think it should be just a single category with both XML trace listener and database trace listener inside. Can you please correct the config and try again.

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 8, 2010 at 5:19 PM

Valiant,

Thanks for your reply. I have modified the config file as shown below. After this change I can see that it's trying to write data in my sql tracefile but it fails because Title field is missing and Date timestamp format is not right. May I know how can I change that and put a fake title

 

 <categorySources>
      <add switchValue="All" name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="XML Trace Listener" />
    <add name="Database Trace Listener" />
        </listeners>
      </add>
    
    </categorySources>

Jan 11, 2010 at 4:59 AM

You could check the Template property of the formatter you used.  But I don't think it would fail even if the Title is not included in the Template.  As for the Date timestampt format, did you changed anything in Template?  I suggest you configure a trace listener under the Logging and Errors Warning and see if there were any other exceptions which occurred.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 11, 2010 at 5:05 AM

Sarah

My templete is like below

 

<add template="Timestamp:{timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
    type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    name="Text Formatter" />

 

I see theat SP while inserting log in the SQL trace that the Data has two quotes instead of 1 and the SP is failing. and Title does not take null that's why it's not inserting records. If I modify this and maully run the SP everything is fine. chaning the templete seems to have no effect what's so ever.

 

below is my listner config

 

<add databaseInstanceName="LoggingconnectionString" writeLogStoredProcName="WriteLog"
        addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
 listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Database Trace Listener" />

Thanks again for your reply.

Asish

Jan 12, 2010 at 4:54 AM

Hi,

I think that the formatter is irelevant to the failure of the log. since it will only affect the formattedMessage column of the Log table. If you want to try a fake title you may specify that in the Logger.Write(..) method, see its overloads. Also you might want to try Sarah's suggestion which is to attach a tracelistener in the errors and warnings section, for you to catch some exceptions that might have occurred during the logging process.

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 12, 2010 at 2:33 PM

Valiant,

I don't write debugger.write to log my errors. It's configured in my config file to listen to eventrace listner and rewrite them to database. I opened the entlib solution to debug it. The problem is that WCF tracelistner does not have the Log.title property. As it's null and Stored Proc expects the parameter, it's failing. if I modify the code and put a default title if it's Null everythign is fine. I am wondering if I can achieve something without modifying entlib code.

 

Asish

Jan 13, 2010 at 5:23 AM

I tried to repro your case but I couldn't. 

I did a simple testing by creating a simple wcf service following the configuration setup mentioned in the documentation for integration logging with wcf.  I call its method containing one line of code for Logger.Write.  When I browse my .svc file, I already obtain logs in my database (even before the call to the method which has the Logger.Write call) as my switchValue defined for the EntLibLoggingProxyTraceListener is set to "All".  In my profiler, it passes an empty string to the Title parameter.

"It's configured in my config file to listen to eventrace listner and rewrite them to database." - So when does your event trace listener fires?  Is it when an error occurs?  Could you provide the exact repro steps?

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 13, 2010 at 2:44 PM

Instead of an emptystring, it passes a Null for the title and Title is not a null field and the SP fails. Once I modified the entlib code to handle the null title , it works

Jan 13, 2010 at 10:42 PM

Sarah,

my stuff is working with Entlib 4.1 can I achieve the same thing with Entlib 4.0 with ACA.Net 4.0.

Jan 13, 2010 at 11:28 PM

Can Entlib 4.0 and 4.1 work side by side. There are some breaking changes in DAta module in 4.1 and I want to use 4.0 data and 4.1 logging. what Common Dll I should use. any trick or suggestion would be highly appreciated.

 

Jan 14, 2010 at 8:34 AM

Hi,

I have never really tried having 2 different version of ent lib in a single application. But reading the documentation (http://msdn.microsoft.com/en-us/library/dd203254.aspx) says that it is possible to have different version of ent lib in a single app, but they are deployed in different directories. Please read in the link provided.

 

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 20, 2010 at 5:08 PM

Thanks Valiant for your response

 

I am running 4.0 and 4.1 side by side and it's working fine. I have a different issue though. I am able to use EntLibLoggingProxyTraceListener and it forwards Messages from Servicemodel and writes to my entlib Logging database, however it does not do the same for tracing. I want to capture trace errors too. How can I achive the same. Please find my config entry.

<system.diagnostics>
  <sources>
   <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
    <listeners>
     <add type="System.Diagnostics.DefaultTraceListener" name="Default">
      <filter type="" />
     </add>
     <add name="ServiceModelMessageLoggingListener">
      <filter type="" />
     </add>
     <add name="traceListener"
       type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,
                     Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=170c2348f126d056" >
      <filter type="" />
     </add>
    </listeners>
   </source>
   <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing"
     propagateActivity="false">
    <listeners>
     <add type="System.Diagnostics.DefaultTraceListener" name="Default">
      <filter type="" />
     </add>
     <add name="ServiceModelTraceListener">
      <filter type="" />
     </add>
     <add name="traceListener"
     type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener,
                     Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=170c2348f126d056"  >


      <filter type="" />

     </add>

    </listeners>
   </source>
  </sources>
  <sharedListeners>
   <add initializeData="App_messages.svclog"
     type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
     name="ServiceModelMessageLoggingListener" traceOutputOptions="ProcessId, DateTime">
    <filter type="" />
   </add>
   <add initializeData="App_tracelog.svclog"
     type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
     name="ServiceModelTraceListener"   traceOutputOptions="ProcessId, DateTime" >

    <filter type="" />
   </add>

  </sharedListeners>
 </system.diagnostics>

Jan 20, 2010 at 6:20 PM

Please ignore my previous query. I have added a new category and it works fine now.