473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Trace Listeners

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
3 1528
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Geopsaros | last post by:
Hi! I have created a custom trace Listener class, called "DBTraceListener" it works fine when i add it manually in code : (eg. Trace.listeners.add(new DBTraceListener("myDBListener",...
2
by: Ken | last post by:
I would like to start using EventLogTraceListener, and am running into a couple of significant limitations: 1) I have found that there is no way to write EventLog entries with different...
2
by: Wilfried Hoermann | last post by:
Presumably a trivial question... I want to write trace information from a web service to a log file using the Trace Class. Is this possible without closing and opening the Trace in every single...
2
by: S. Han | last post by:
I use Trace.Assert() through out my app and it's such a great way to debug a program. My question is is there any way to redirect the assertion pop-up to the command line output in my console...
3
by: Jens Alenius | last post by:
I've been looking at the Trace and TraceSwitch Classes i C# and I thrying to make it act more like java log4j. What I want is to add two different tracelisteners (like EventLogTraceListener and...
5
by: guy | last post by:
Where do I get trace output? Trace.Write("Hello World");
1
by: Patrick | last post by:
When Tracing in ASP.NET, the IIS process (on IIs5.1) is locking on the Trace file, and I can't read the trace file without restarting the IIS: Even the following does NOT work (how could I fix...
0
by: msnews.microsoft.com | last post by:
Hi, I am tring to use Trace Listener in asp.net 1.1 application as mentoned here. But i am getting the following error, Configuration Error Description: An error occurred during the processing...
6
by: Zytan | last post by:
According to http://www.15seconds.com/issue/020910.htm I am doing this in the c'tor of a 'logfile' class: objStream = new System.IO.FileStream(logFilename, System.IO.FileMode.OpenOrCreate);...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.