471,616 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Retrieving initializeData attribute from TextWriterTraceListener

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?

Apr 4 '08 #1
2 2552
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
Apr 4 '08 #2

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
Apr 4 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Walter L. Williams | last post: by
reply views Thread by Kurt Ng | last post: by
3 posts views Thread by Frustrated Newbie via DotNetMonster.com | last post: by
3 posts views Thread by gslim | last post: by
reply views Thread by WT | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.