Tuesday, December 31, 2013

Trace listener and logging trace in a file

Possible to create and use a trace listener in code or by using a configuration file, as it’s easier to change configuration file without touching the code I tried to add it for a WebApi REST service by the following code for Telerik reports:

<system.diagnostics> <trace autoflush="false" indentsize="4"> <listeners> <add name="WebApiRESTListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="Services.Reporting.REST.Tracing.log" /> <remove name="Default" /> </listeners> </trace> </system.diagnostics>

Share/Bookmark

No comments: