Glimpse is an amazing tool (that comes available with Nuget in Visual Studio 2010 [included in the Tools Update]) that can hook into the System.Diagnostic.Trace (ewww) to display error messages on your client side browser. Like so:
I don’t want to use System.Diagnostics as my Logging system. I could use it on the side, but not as the core. This would be awful and much too rigid. The good thing is, I typically use Common.Logging in all my projects because of it’s way to tie ANY LOGGING SYSTEM into a single point then ship those events off to any other receiving system. The receiving system in this case, is of course, System.Diagnostics.Trace using the TraceLoggerFactoryAdapter
So to get to the point above this is what I did:
- Using Create a new MVC project in VS2010
- Nuget
- Install-Package Glimpse
- Install-Package Common.Logging
- Add Common.Logging to the web config
<!--...config sections... --> <sectionGroup name="common"> <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> </sectionGroup> <!--...configuration... --> <common> <logging> <factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e"> <arg key="level" value="ALL" /> <arg key="showLogName" value="true" /> <arg key="showDataTime" value="true" /> <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" /> </factoryAdapter> </logging> </common>
- Add some “problems”
- Run the project and go to http://[your project url]/Gimpse/Configthen click “Turn Glimpse On”. Don’t be surprised that nothing happens.
- Go to your main page http://[your project url]/ – See the icon in the right hand corner? Click that.
- Look at those errors!
Conclusion?
Amazing! The guys who made Glimpse deserve some sort of medal!
Pingback: ASP.Net MVC 3 Project Setup (with Glimpse, ELMAH & MiniProfiler)
I am more of a front end developer with inrmteediate experience on the back end, so please forgive my inability to answer these questions on my own:Could you provide an example or two where this would be useful? Maybe you could discuss the pros and cons of this as opposed to web services or update panels. Would this work with forms? thanks
The usefulness of this is that you can see the model that you are working with; the errors that have occurred; route selection; etc. Basically everything.
If you are wanting to learn more about it, go over to http://getglimpse.com/About and check it out