I have a wcf service that sometimes creates errors like "The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'". I know how to fix this particular problem, but now I want to create a trace that saves only Errors (and Critical errors) to the log.
The problem is that my log saves either everything (including successful calls) or nothing at all. So my question is, what is wrong with my web.config?
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel" propagateActivity="true" switchValue="Error">
<listeners>
<add name="xml">
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\mylog.svclog"
type="System.Diagnostics.XmlWriterTraceListener"
name="xml" />
</sharedListeners>
</system.diagnostics>
I have tried with all different combinations of the switchValue, but none gives me the result I want (= catch errors, but not successful calls).
Does anyone have an idea?