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
- 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=22.214.171.124, 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!
Amazing! The guys who made Glimpse deserve some sort of medal!