By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,563 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,563 IT Pros & Developers. It's quick & easy.

Trace Listeners

P: n/a
Hi,
Can anyone tell the advantages/dis-advantages of adding a listener to the
listeners collection? In MSDN it says that listeners not in the collection
do not recieve all trace output. What will be missing?
--
Rgds,
Jun 12 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Trace.WriteLine("Tracing.....");

the statement above sends output to the listeners collection. Consequently,
if a listener is not in the collection, it would not receive such output.
(It would only receive any output sent to it directly, such as
'myTraceListener.WriteLine("Direct output");').
Note that the DefaultTraceListener is automatically included in the listener
collection.

Tor Bådshaug
tor.badshaug [//at\\] bekk.no.

"Absolon" <Ab*****@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hi,
Can anyone tell the advantages/dis-advantages of adding a listener to the
listeners collection? In MSDN it says that listeners not in the
collection
do not recieve all trace output. What will be missing?
--
Rgds,

Jun 12 '06 #2

P: n/a
Thanks. I think I get it now. How does this sound:
Listeners in the collection ALL get written to using
Trace.Write/WriteLineIf() etc, at roughly the same time, but can be written
to individually if stated by name eg myListener. WriteLineIf(). Whereas
Listeners outside of the collection can only be written to by name.

--
Rgds,
"Tor BÃ¥dshaug" wrote:
Hi,

Trace.WriteLine("Tracing.....");

the statement above sends output to the listeners collection. Consequently,
if a listener is not in the collection, it would not receive such output.
(It would only receive any output sent to it directly, such as
'myTraceListener.WriteLine("Direct output");').
Note that the DefaultTraceListener is automatically included in the listener
collection.

Tor BÃ¥dshaug
tor.badshaug [//at\\] bekk.no.

"Absolon" <Ab*****@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hi,
Can anyone tell the advantages/dis-advantages of adding a listener to the
listeners collection? In MSDN it says that listeners not in the
collection
do not recieve all trace output. What will be missing?
--
Rgds,


Jun 13 '06 #3

P: n/a
Yes, you've got it right now :-)

Tor Bådshaug
tor.badshaug [//at\\] bekk.no.

"Absolon" <Ab*****@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
Thanks. I think I get it now. How does this sound:
Listeners in the collection ALL get written to using
Trace.Write/WriteLineIf() etc, at roughly the same time, but can be
written
to individually if stated by name eg myListener. WriteLineIf(). Whereas
Listeners outside of the collection can only be written to by name.

--
Rgds,

Jun 13 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.