Evil Dev's Blog

Plots, Schemes, and Plans to take over the Devleoper world.... Mu hahahaha


News

For all those who are interested, the .NET User Group Meetings here in Winnipeg are starting up again next Thursday, check out Winnipeg's .Net user group Home Page for details.

My Stats

  • Posts - 14
  • Comments - 13
  • Trackbacks - 0

Recent Comments


Recent Posts


Article Categories


Archives


Post Categories


Blogs I Like


Cool Sites


 

Let's face it, it needed a rename. Mitch.Web just lacks everything in terms of marketing, so I've re-branded my (currently error logging :P) framework to "The Evil Little Developer's Toolbox" in game with my EvilDev theme. I've also made advancements (not guaranteed to work yet) on my error logging framework, mostly in terms of a new Services Project, and the Logging Service. The logging service, is a WCF Service, designed to log errors to a database.

The idea behind it, well, I generally focus my efforts towards Web Applications, and one thing I've been looking for, and haven't had much luck in finding is, a standardized end-to-end error logging solution. I like to know when my javascript breaks, or my silverlight application has a heart attack. I like to know when my flash components fail horribly. Now, each platform has methods of error logging (let's face it, this isn't exactly a "new" concept). I haven't had much chance to play with WCF before this, so I figured I could kill two birds with one stone if you will.

Once I solidify my service code, (and hopefully find a pleasant way to make it easily redistribute), I'll set about writing libraries for the various platforms I plan to support (I want to be able to simply include a js file in my GlobalMaster.aspx for example, and have all javascript errors logged).

It's a rather simple Architecture, requiring only some basic error info/log message, and a Registered Application Guid (to ensure not just anybody can log to my service.

Anyways, if you feel like checking it out, codeplex URL has been changed (although apparantly the old url will just redirect), so check it at:

http://evildevtoolbox.codeplex.com/

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

Well, my logging framework is pretty solid I think, still needs further practical testing, but so far working alright.

Today, a co-worker proposed a challenge to me, in the form of a general comment. He mentioned how our current error logging framework at work functioned (we use ELMAH). Which got me thinking.

ELMAH works, by implementing an HttpModule, which catches web applications "OnError" event if you will, logs them and lets the app go on it's merry way.

Digging into HttpModules, I discovered that kind of functionality is extremely easy to implement, so I've added a new class to my framework called "HttpErrorLoggingModule" that implements the IHttpModule interface.

There's not much code, so if your interested just pull down the source of codeplex and dig into it.

I also enhanced my "GenericLogger" so now when logging errors it'll do a recursive write of all inner exceptions as well, and it checks if the Exceptions "Data" property contains anything, and write out all those values as well.

The reason I did this, is so my HttpErrorLoggingModule could then append data about the Current HttpContext to the exception itself to be logged, similar to the way Elmah records that stuff.

I know, why don't I just use Elmah? Partially because I've found with working with it, that there are some shortfalls, specifically, if there's a weird low impact exception being thrown, but it's thrown every minute or so, if an issue is already logged related to that exception it should not be spamming me with email. By building a similar module ontop of my own framework, I open that kind of flexibility up.

Plus, the core code is only like 30 lines long (if that), so it's not exactly complicated.
So if your interested, it's up on CodePlex here: http://mitchweb.codeplex.com/


Anyone, I'm going to challenge you my readers with something as well, cause for the life of me, I don't know how to do it.

I want to add this kind of functionality to my framework, for Console/WinForms/WPF applications as well, something that preferably wouldn't require a recompile of the client application, and could be setup merely by copying dll's and adding some configuration. I know it's easy enough to instantiate an error event handler in the main access point of the application, but I'm wondering if there's a way to do it without touching the client, like Elmah. Any help I'd greatly appreciate :)

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

I recently decieded to start merging some of my code that I use in a lot of my little projects into a centralized framework, and provide a consistant API for them. (As well as give me a reason to experiment with Visual Studio 2010 ^^).

So today, I released a pre-alpha version of the "Mitch.Web" framework, currently only semi-complete API is the ILogger framework, inspired by Uwe Schmitz demo presentation (with a few design/enhancements I felt were necessary).

API is similar to Uwe's, with a couple of key exceptions, instead of using Unity to auto construct the configured logger, I built a .NET Config Section/Handler for the configuration, and exposed it in a Global Module called "App". The advantage of this approach, is my configuration settings are a bit more flexible, and allow multiple loggers to be used at any given time, as well as referencing a specific logger by a key specified in the config file.

Configuration is highly dynamic, allowing you to specifiy parameters for your constructor, as well as providing parameters for parameters etc recursively instatiating all dependcies.

It does use reflection for instatiation, but currently it caches the final logger collection in memory, so it only instatates once. I plan to improve on this in the future for longer running process like services and web applications, in which I will throw it into a cache with a dependency on the config file the collection was instatiated from, so that if the configuration changes it will refresh the logger collection on the fly.

There are a couple other gems in there that are kind of neat, I'm going to be enhancing this framework for some time yet, but if you want to check it out now, in early development and provide feedback it would be most useful, especially this early in the life cycle. Not much documentation yet I'm afraid, but I promise before I release the full release, all libaries and API's will be fully documented.

So if your interested, it's up on CodePlex here: http://mitchweb.codeplex.com/

Couple of things to note:
- You need to download Visual Studio 2010 Beta 2 in order to open the source
- Written in C#, although maybe someday I'll create a VB version as well.
- Released under an MIT License.

Enjoy!

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati