Link to home
Create AccountLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

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.TextWriterTraceListener" name="ELoftLocalListener" />
                    <add name="consoleListener" /> -->
                </listeners>
            </source>
        </sources>
        <sharedListeners>
<!--            <add initializeData="ELoft.log" type="System.Diagnostics.TextWriterTraceListener" name="ELoftLocalListener" />
           <add name="consoleListener" type="System.Diagnostics.ConsoleListener"/> -->

        <!--     <add initializeData="output.xml" type="System.Diagnostics.XmlWriterTraceListener" name="xmlListener" traceOutputOptions="Timestamp" /> -->
            <add initializeData="ELoft.log" type="System.Diagnostics.DelimitedListTraceListener" name="ELoftListener" traceOutputOptions="Timestamp" />
            <add type="System.Diagnostics.ConsoleTraceListener" name=" consoleListener" traceOutputOptions="Timestamp" />
        </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(TraceEventType.Start, 0);  //  trace
            traceSource.TraceInformation("\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.
Avatar of devsolns
devsolns

<%@ Page Trace="true" %>
disregard my post, ; )
Avatar of rmmarsh

ASKER

Moderator:  please close this... I figured it out myself.
Avatar of rmmarsh

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.
ASKER CERTIFIED SOLUTION
Avatar of kodiakbear
kodiakbear

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer