T
Tony Johansson
Hi!
I'm reading in a book and it says the following.
Trace.Listeners.Clear();
Trace.Listeners.Add(new XmlWriterTraceListener(@"C:\output.xml"));
Trace.AutoFlush = true;
Trace.WriteLine("This is a test");
This can also be configured using the following.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="true" indentsize="5">
<listeners>
<add name="DemoListener"
type="System.Dignostics.XmlWriterTraceListener" initializeData="output.xml"
/>
<remove name="Default" />
</listeners>
</trace>
</system.diagonstics>
</configuration>
Now to my question what do I have to write in the code to be able to use
this configuration file ?
//Tony
I'm reading in a book and it says the following.
Trace.Listeners.Clear();
Trace.Listeners.Add(new XmlWriterTraceListener(@"C:\output.xml"));
Trace.AutoFlush = true;
Trace.WriteLine("This is a test");
This can also be configured using the following.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="true" indentsize="5">
<listeners>
<add name="DemoListener"
type="System.Dignostics.XmlWriterTraceListener" initializeData="output.xml"
/>
<remove name="Default" />
</listeners>
</trace>
</system.diagonstics>
</configuration>
Now to my question what do I have to write in the code to be able to use
this configuration file ?
//Tony