Enterprise Library Logging vs log4net
I did a presentation today to the Intergen development team on the Microsoft Enterprise Library. As someone who doesn't have much experience with giving presentations I thought it went really well. I've had a lot of positive feedback from co-workers which is nice as I was sure it was going to be a disaster. (Interesting note: During one of my interviews for Intergen, in a moment of foolishness, I gave public speaking as the answer to "What is your biggest weakness?". Just as a reference to all future potential employers: my real biggest weakness is that I just work too gosh darn hard.)
One feature of my EntLib presentation that I thought was worthwhile sharing was a comparison of the Enterprise Library Logging Block verse log4net. All the examples I found on the net comparing the two were out of date. They often compared log4net with the logging in EntLib 1.1, which is quite different from EntLib 2.0 & 3.0.
Here are what I believe are the strengths of each:
Enterprise Library Logging Application Block
- More actively developed - The recently released Enterprise Library 3.0 contained a number of new features for logging, including WCF support. The last release for log4net on the other hand was over a year ago.
- Takes advantage of and supports newer technologies - The 3.0 release included support for WCF.
- Integrates with other application blocks - The Policy Injection Block and Exception Handling Block both include logging handlers to automatically invoke the Logging Application Block.
- Very extensible - Pretty much all aspects of the Logging Block can be extended and customized. You can create your own TraceListeners, Filters and Formaters quite easily.
- Configuration tool - Enterprise Library comes with a great tool for creating and modifying its configuration sections. This takes away a lot of the pain and guess work of configuring the EntLib application blocks.
log4net
- Works with .NET 1.0 & 1.1 - The much improved logging of EntLib 2.0 and above is only available if your application is running on .NET 2.0 or greater. log4net however works on all versions of .NET.
- Simpler install - When using the Enterprise Library there are some services you really should install. This is as simple as running a bat file included with EntLib but it does complicate your deployment process.
- Slightly faster - log4net was significantly quicker than EntLib 1.1 logging. EntLib 2.0 onwards has improved its performance but log4net remains slightly faster. A benchmark I found while researching my presentation had EntLib taking approximately 5-6 seconds to log 100,000 entries while log4net took about 3 seconds. Does the speed difference matter? Probably not. However log4net net does support...
- Appender Buffering - Buffering support with some appenders lets log4net queue up log entries and write them in a single go. If you are writing entries to the database then buffering is a good way to improve performance.
- More platforms - Enterprise Library does not support the .NET Compact Framework while log4net does.
If you have any other thoughts on the Logging Application Block or log4net I'd love to hear them.
Community Server 2007
Although not much appears different on the outside, last night I updated this blog to Community Server 2007. Although I'm always wary of updating something the size and complexity of CS, like before I found the CS upgrade process to be a relatively pain free experience.
One of the nice new features that aided in the update is the concept of override config files. Rather than updating the dauntingly large Community Server .configs, you can put your changes in a new file, i.e. communityserver_override.config. No more trial and error merging.
Community Server's new skinning system is also something I looked at while upgrading and I spent a couple of hours porting my old skin to the new system. Overall I found it was much nicer to use than what CS previously had. One thing that jumped out was the reduction in files. A skin previously was spread over a ridiculous number of files, and half the battle was just finding the one you wanted to edit. In CS 2007 it is down from 55 to a much more manageable 8 according to the documentation.
Also new is blog 'file storage' which you can read about here. Rather than entering this post using the CS control and manually uploading an image like I have previously done, this post is written in Windows Live Writer. Windows Live Writer not only automatically adds the post to CS, but it uploads the image (the one right below the title) into the specified blog storage directory and links everything up for me. Cool!
Finally I noticed that Community Server has FeedBurner support which I've signed up for. My FeedBurner URL is http://feeds.newtonking.com/jamesnewtonking.
Good job Community Server people.
Json.NET and MonoRail
I learnt today that MonoRail is using Json.NET for its JSON support. The license I release my free projects under is pretty permissive so I don't often get a chance to learn what they're being used with. To hear that Json.NET is being used with something the size and quality of MonoRail is pretty cool [:)]
Sitemaps.org
I'm surprised I missed this: sitemaps.org
Google, Microsoft and Yahoo are collaborating together on a sitemap XML format. Because the format is essentially the same as what Google is already using, GoogleSitemap.NET can now be used with all the major search engines [:)]