logging - Why can't I trace just errors on the service side of my WCF? -


I have a WCF service that sometimes generates errors such as "Inner Exception Message" the maximum number of items Can be serialized or '' 65536 '' in the object graph, I know how to fix this particular problem, but now I want to create a trace which only errors (and serious errors) in the log Saves you.

The problem is that my log either saves everything (including successful calls) or nothing, so my question is, what is wrong with my web.config?

 < Code> & lt; system.diagnostics & gt; & lt; trace autoflush = "true" /> & lt; sources & gt; & lt; source name = "System.ServiceModel" propaganda spread = "true" switchwall = "Error" & gt; Listener & gt; & lt; Add Name = "xml" & gt; & lt; / add & gt; & lt; / listeners & gt; & lt; / source & gt; Lt; / sources & gt; & lt; sharedListeners & gt; & lt; initializeData = "C: \ mylog.svclog" type = "System.Diagnostics.XmlWriterTraceListener" name = "xml" /> & Lt; / SharedListeners & gt; & Lt; /system.diagnostics>  

I have tried with all the different combinations of switchValue, but no one results in me (= catching errors, but not successful calls).

Anyone have an idea?

If you need service-side logging only, you can check which interface You can put in your service class.

This interface will expose two ways:

  public child handlere (exception error) public zero provider default (exception error, message trust, ref message message)  

which will allow you to tap into all the exceptions on the service-side - log in those log files, and you should be ok.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -