Trace Listeners

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

Guest

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?
 
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.
 
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 said:
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 said:
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?
 
Back
Top