Using DebugView for .net MVC Production Environment

Edit
Tracing or Debugging in production environment is always a pain in the ass because there might be lots of user or process is going on in production environment and you cannot really STOP everything sometime or you can only reproduce the problem on the production machine.

My ex-supervisor has describe a methodology he was using and now I am documenting that here so that the future me or any interested parties could apply it. (This is written with a .net MVC web application in mind, you might extend the same idea on your own project)

1. We will use the debug and trace class in the System.Diagnostics package
2. Create flag in Web.config to turn on and off debug and trace
3. build a wrapper class for trace and debug so that it will check the flag in web.config before writing the debug or trace
4. In your code, use your wrapper class written in step 3 and apply trace and debug statement appropriately to log anything progress on your code
5. deploy your program with the debug and trace in place to production environment
6. depending on your web application, set the debug and trace flag in web.config. Say we will turn everything off in normal case.
7. When there is a bug / error occurs, go to the web.config in the production environment and turn on the debug and trace flag
8. on your production environment, install DebugView
9. You should be able to see the debug and trace code emit from your program in DebugView, just like this link is showing Using DebugView to catch debug output of .NET program

That was the setup being inspired by my ex-supervisor, do you have a better debug setup on production environment? Please let me know!
Using DebugView for .net MVC Production Environment Using DebugView for .net MVC Production Environment Reviewed by DF on 6:36:00 PM Rating: 5
©DF. Powered by Blogger.