Pages

Ads 468x60px

Labels

Thursday, February 7, 2013

Listeners : 8





So in this example the config file the controls compilation of the component is in the web.config and the important setting here is I have a compiler options attribute that specifies that I want to output trace messages to have compiler options here for both C sharp in VB because you can have code of both types within that Apco directory so by including both have the flexibility of including trace information for any kind of code that I put within that Apco directory that location is special within ASP.net.

Applications right with that the application all set up so go ahead and run until select defaults and executed and I'll click on the webpage trace listener back over to Visual Studio as you can see the trace output is in the output window and I have the system.diagnostics.trace messages included in integrated together with the ASP.net trace information is all integrated together and have a single view of that data will put this back I'm not limited to viewing information the output window I can also included within a page trace.

 The application open up my default.aspx and add the trace attribute save it and I'll run the page again I'll click on the webpage trace listener and I can scroll down here and see that the trace messages from that component are available within the trace information for the page got a nice it gives you a nice unified view of all of the trace information that is generated by the application whether generated by ASP.net or an outside component quantity one of the thing here, scroll down and disable the debug mode by setting the false will save that middle restart the application without debugging all select the webpage trace listener and once again come back and show you that the output window does not include the trace information this is important because a deployed application will not execute in debug mode and so there's no place for that debug information to go but you can still use trace information and output to different listeners and be able to gather it in different ways




Summery

Okay so that's a pretty convoluted code for using tracing features in your application but having consolidated view of everything going on in your application including custom messages that you add to the next can be enormously useful when you need to find a problem for monitoring application best of all their even more ways to monitor your code

0 comments:

Post a Comment

 

Sample text

Sample Text

Total Pageviews