none
How to configure a default trace source? RRS feed

  • Question

  • Hello everyone,

    Let's say I use third party assemblies, and they write something to their trace sources, but I don't know the names of the source. Is it possible to create a default trace source, so all trace messages for non-existing sources would go to this source?

    It is very easy  in Java logging configuration. Is it possible in C#?

    Thanks,

    Vlad

     


    Thanks
    Wednesday, November 24, 2010 4:34 PM

All replies

  • Hi

    Trace sources (System.Diagnostics.TraceSource objects) can be created and initialized with or without the use of configuration files. There is a topic that provides instructions for both options. However, we recommend that you use configuration files to facilitate the reconfiguration of the traces produced by trace sources at run time.

    Click here to get the article.

    Best Regards,


    Please mark the right answers which satisfy your requirements.That will be helpfull for all community members. Thanks, Cookie
    Friday, November 26, 2010 1:55 AM
  • Hello Cookie,

    The problem is that I want to use 3-d party DLL, and 1) I have no their source code 2) I don't know which trace sources or switches they use.

    My question was: is it possible to redirect all tracing for these sources to a specific source?

     


    Thanks
    Friday, November 26, 2010 4:09 PM
  • Hi

    You should kown more trace source about the Dll.

    So you need ask for document of the Dll from the Dll provider.


    Please mark the right answers which satisfy your requirements.That will be helpfull for all community members. Thanks, Cookie
    Monday, November 29, 2010 5:19 AM
  • Hello Cookie,

    Well, if I know the source/switches names, it is easy to do the rest.

    Does your answer mean that without the names it is impossible to configure the tracing?


    Thanks
    Monday, November 29, 2010 4:53 PM