rmmarsh
asked on
no output from TraceSource
Here is my config file...
<system.diagnostics>
<sources>
<source name="raceCode" switchName="switch2">
<listeners>
<!-- <add initializeData="ELoft.log" type="System.Diagnostics.T extWriterT raceListen er" name="ELoftLocalListener" />
<add name="consoleListener" /> -->
</listeners>
</source>
</sources>
<sharedListeners>
<!-- <add initializeData="ELoft.log" type="System.Diagnostics.T extWriterT raceListen er" name="ELoftLocalListener" />
<add name="consoleListener" type="System.Diagnostics.C onsoleList ener"/> -->
<!-- <add initializeData="output.xml " type="System.Diagnostics.X mlWriterTr aceListene r" name="xmlListener" traceOutputOptions="Timest amp" /> -->
<add initializeData="ELoft.log" type="System.Diagnostics.D elimitedLi stTraceLis tener" name="ELoftListener" traceOutputOptions="Timest amp" />
<add type="System.Diagnostics.C onsoleTrac eListener" name=" consoleListener" traceOutputOptions="Timest amp" />
</sharedListeners>
<switches>
<!-- <add name="switch1" value="Critical" /> -->
<add name="switch2" value="Warning" />
</switches>
</system.diagnostics>
I have #define TRACE at the top of my file where I am doing the trace. My trace statement looks like this:
traceSource.TraceEvent(Tra ceEventTyp e.Start, 0); // trace
traceSource.TraceInformati on("\n\n-- > trace info\n\n");
and I flush() and close() when the program ends. Why do I not get any output? and where is it supposed to go? I am running this under the debugger of VS 2005 Express.
Thanks in advance.
<system.diagnostics>
<sources>
<source name="raceCode" switchName="switch2">
<listeners>
<!-- <add initializeData="ELoft.log"
<add name="consoleListener" /> -->
</listeners>
</source>
</sources>
<sharedListeners>
<!-- <add initializeData="ELoft.log"
<add name="consoleListener" type="System.Diagnostics.C
<!-- <add initializeData="output.xml
<add initializeData="ELoft.log"
<add type="System.Diagnostics.C
</sharedListeners>
<switches>
<!-- <add name="switch1" value="Critical" /> -->
<add name="switch2" value="Warning" />
</switches>
</system.diagnostics>
I have #define TRACE at the top of my file where I am doing the trace. My trace statement looks like this:
traceSource.TraceEvent(Tra
traceSource.TraceInformati
and I flush() and close() when the program ends. Why do I not get any output? and where is it supposed to go? I am running this under the debugger of VS 2005 Express.
Thanks in advance.
<%@ Page Trace="true" %>
disregard my post, ; )
ASKER
Moderator: please close this... I figured it out myself.
ASKER
I found the answer myself at http://msdn2.microsoft.com/en-US/library/system.diagnostics.tracesource(VS.80).aspx
The switch value has to be set to "All" to get what I was tracing.
The switch value has to be set to "All" to get what I was tracing.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.