c# - How to enable wcf tracing prgrammatically? -
I have a WCF service (project output type-window application) that is hosted as a Windows service. All client and server logic is in the C # code and I do not have any configuration files. I need to enable wcf tracing without using the config file. How can I do this?
You can configure the program that you file your Note that you can set all properties (log level, for example), as you would with the attributes in your You can also add your custom filter: .config If you initialize your service, just add this code (customize it according to your logging requirements):
var listener = new XmlWriterTraceListener ("Log.xml"); Debug.Listeners.Add (listener);
.config file Do:
debug Etoflu = true; Listner. TraceOutputation = Traceaptis. call stack;
listener.filter = new MyCustomTraceFilter ();
Comments
Post a Comment