Retrieving initializeData attribute from TextWriterTraceListener

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Retrieving initializeData attribute from TextWriterTraceListener

    I set up a TextWriterTrace Listener in the App.config file. I'd like to be
    able to tell, programmaticall y, which file it's using. However, I don't seem
    to be able to get at the initializeData attribute. The Attribute collection
    attached to the TextWriterTrace Listener is empty.

    Any ideas as to how I might get at this file name without having to parse
    App.config?

  • Marc Gravell

    #2
    Re: Retrieving initializeData attribute from TextWriterTrace Listener

    config is largely for things that are known... if you need to do this on
    the fly, then try:

    Trace.Listeners .Add(new TextWriterTrace Listener(path)) ;

    Marc

    Comment

    • Marc Gravell

      #3
      Re: Retrieving initializeData attribute from TextWriterTrace Listener


      Sorry - I may have misunderstood the question. I suspect you'll struggle
      to do this the other way around (i.e. find the file from the listener) -
      sorry.

      Marc

      Comment

      Working...