WCF trace logs all exceptions except System.Exception itself -


i've made basic wcf service library , created 1 method called getresult(). i've set wcf trace logging log warnings file. correctly logging exceptions thrown except, strange reason, system.exception itself. instance, logs fine:

[operationcontract] public string getresult() {     // exception logged in file:     throw new dividebyzeroexception();     // or     // throw new applicationexception();     // or     // throw new filenotfoundexception();     // or else, seems } 

but not log anything:

[operationcontract] public string getresult() {     // exception not logged!     throw new exception();     // or     // throw new exception("my message"); } 

in latter case, log file doesn't created. if exists doesn't written to.

what doing wrong?

here app.config setup:

<system.diagnostics>     <sources>         <source name="system.servicemodel.messagelogging" switchvalue="warning">             <listeners>                 <add name="servicemodeltracelistener" />             </listeners>         </source>         <source name="system.servicemodel" switchvalue="warning">             <listeners>                 <add name="servicemodeltracelistener" />             </listeners>         </source>         <source name="system.runtime.serialization" switchvalue="warning">             <listeners>                 <add name="servicemodeltracelistener" />             </listeners>         </source>     </sources> <trace autoflush="true" />     <sharedlisteners>         <add initializedata="c:\temp\logs\wcf.svclog"         type="system.diagnostics.xmlwritertracelistener, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"         name="servicemodeltracelistener"         traceoutputoptions="timestamp" />     </sharedlisteners> </system.diagnostics> 


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -