<configuration>
<system.diagnostics>
<switches>
<add name="DemoApp.Switch" value="Information"/>
</switches>
<trace autoflush="true" indentsize="5">
<listeners>
<add name="DemoListener" type="System.Diagnostics.XmlWriterTraceListener"
initializeData="output.xml" />
<remove name="Default" />
<add name="DemoListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="output.txt" />
<remove name="Default" />
<add name="DemoListener"
type="System.Diagnostics.DelimitedListTraceListene r"
delimiter="|"
initializeData="C:\\output.txt"/>
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
i have different listener u can use it according to uer convience
"DoB" wrote:
Hi,
I was trying to configure the Trace class using the app.config. I was
followig the example configurations in the MSDN.
However, as I debug the program, the Trace class seems to ignore the
configuration. For example - it has its default and only listener while I
removed it and added some other listeners in a config file.
Am I missing something? Is any explicit call needed to load the trace
configuration part?
DoB