Trace Source and Trace Listener at Runtime RRS feed

  • Question

  • <system.diagnostics> 
          <source name="System.ServiceModel" 
          switchValue="Information, ActivityTracing" 
              <add name="console" /> 
          <source name="System.ServiceModel.MessageLogging" 
              <add name="console"/>  
          <add name="xml" 
           initializeData="d:\temp\Traces.svclog" /> 
          <add name="console" type="System.Diagnostics.ConsoleTraceListener"/>  
        <trace autoflush="true"/>  

    1. is it possible with c# at runtime all of settings.
    2. is it possible a trace listener(s) (like System.ServiceModel) stop or start.
    Wednesday, October 8, 2008 7:28 PM

All replies

  • I don't know if you have seen this, but a few things can be updated:


    Trace Source: You can use a different TraceSource at runtime

    1. Switch value

    Trace Listeners. Though the property of the listener can be modified, it is not possible to change the listeners.

    1. Name
    2. Output options
    3. Filtering options
    Wednesday, October 8, 2008 10:18 PM
  • I want control listener specially on System.ServiceModel, start and stop System.ServiceModel listeners at runtime.
    Thursday, October 9, 2008 7:08 AM
  • I know that you've probably already answered your question, but I was looking for how to set up TraceSource and TraceListeners at runtime too.  I found this:

    So, to answer your first question: Yes, you can do it at runtime, without a config (see the linked page)

    I'm sure that you've found an answer for your second question.

    Wednesday, September 23, 2009 5:11 PM