Search code examples
.netwcfiisiis-7

WCF "value cannot be null" error in event log


The log in my server is full with this error cause by WCF, I guess. I tried for days to find what's causing it, but no luck. My WCF services (4.0) are hosted in iis and as far as I know, working well. Maybe someone knows?

enter image description here


Solution

  • I found the way to stop writing every bit of information to the event log. That's what I did: I set TraceLevelSwitch to 1 - errors only.

    <system.diagnostics>
       <switches>
          <!-- This switch controls data messages. In order to receive data 
             trace messages, change value="0" to value="1" -->
          <add name="DataMessagesSwitch" value="0" />
          <!-- This switch controls general messages. In order to 
             receive general trace messages change the value to the 
             appropriate level. "1" gives error messages, "2" gives errors 
             and warnings, "3" gives more detailed error information, and 
             "4" gives verbose trace information -->
          <add name="TraceLevelSwitch" value="1" />
       </switches>
    </system.diagnostics>