How to enable WCF traces programmatically? -


is there way enable/disable wcf trace/logging perticular end point without changing web.config ?

you first need access trace object name, defined in .config file. example:

tracesource ts = new tracesource("system.servicemodel"); 

then can set filter level all, none or in between:

ts.switch.level = sourcelevels.off;   // nothing ts.switch.level = sourcelevels.all;   // ts.switch.level = sourcelevels.warning;   //warning or higher 

btw - tracesource class in system.diagnostics namespace, don't forget appropriate using statement.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -