Pages

Ads 468x60px

Labels

Tuesday, February 5, 2013

Listeners : 2






 The default trace listeners automatically included in every listeners collection if you want to capture trace messages outside of Visual Studio and you have to use one of the other trace listeners and there are several available built-in to the.net framework one of the ones is the text writer trace listener as you might expect from the name this outputs the messages to text.

Writer class which can write them then out to a text file such as log file or you can also output them to any stream such as a network stream or console application event log trace listener outputs all the messages to the event log in again output tracing and debugging information to the event log of a remote computer she could easily set up a listener server and gather all of the messages from all applications across your network the consul trace listener directs tracing or debugging output to either the standard output or other error.

 Stream the delimited list trace listener directs the output in a delimited text formatted text writer such as a stream or to restrain such as a file stream.net framework is very rich support for various streams that you can use to send the output to a wide variety of different media the XML writer trace listener since the output as XML data to a text writer to a stream such as a file stream so you can tell with a lot of these listeners mainly.

The listener format the data in a particular way and then you can output it to a variety of permanent storage locations you can configure as many listeners within an application as you want each one will receive the same messages but each one will do something different with the outputs only messages written as right or worn are forwarded however to the trace listeners that is the listener won't store a copy of the standard ASP.net trace information the information tracked by the listeners is limited to the contents of the trace information section .

Both the trace and debug classes share the same trace listener collection object to Seattle listener to the trace object you will also be available to the debug object and vice versa rights and that's listeners that you can define to receive the output the next thing we need to talk about his trace switches trace switches let you set the granularity of the messages that your code sends to the various listeners that you have defined trace switch objects derive from the system.diagnostics.switch class and are controlled in an application's Web.config file.

What it does is allow you to change tracing behavior without recompiling your code or redefining the various trace objects to tracing code can read the switch settings and determine whether or not to issue particular trace messages in the.net framework provides three different kinds of trace switches the first one is a Boolean switch this acts as a toggle either enabling true or disabling falls.

0 comments:

Post a Comment

 

Sample text

Sample Text

Total Pageviews