Retrieving initializeData attribute from TextWriterTraceListener

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I set up a TextWriterTraceListener in the App.config file. I'd like to be
able to tell, programmatically, 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 TextWriterTraceListener is empty.

Any ideas as to how I might get at this file name without having to parse
App.config?
 
config is largely for things that are known... if you need to do this on
the fly, then try:

Trace.Listeners.Add(new TextWriterTraceListener(path));

Marc
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top