<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Iterator &#187; performance</title>
	<atom:link href="http://theiterator.com/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://theiterator.com</link>
	<description>This is my blog. There are many like it, but this one is mine.</description>
	<lastBuildDate>Fri, 23 Sep 2011 06:35:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Log4net vs. Enterprise Library Logging Application Block</title>
		<link>http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/</link>
		<comments>http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 15:29:53 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[enterprise library]]></category>
		<category><![CDATA[log4net]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[logging application block]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.theiterator.com/?p=55</guid>
		<description><![CDATA[I was contemplating a logging strategy in the context of a customer project and I bumped into this slightly dated performance comparison between log4net and Microsoft Patterns &#38; Practices &#8211; Enterprise Library 3.1 Logging Application Block (which I&#8217;ll refer to as LAB from now on). Considering the fact that our logging library of choice is [...]]]></description>
			<content:encoded><![CDATA[<p>I was contemplating a logging strategy in the context of a customer project and I bumped into this slightly dated <a href="http://weblogs.asp.net/lorenh/archive/2005/02/18/376191.aspx">performance comparison</a> between <a href="http://logging.apache.org/log4net/index.html">log4net</a> and <a href="http://msdn.microsoft.com/en-us/library/dd203099.aspx">Microsoft Patterns &amp; Practices &#8211; Enterprise Library 3.1 Logging Application Block</a> (which I&#8217;ll refer to as LAB from now on). Considering the fact that our logging library of choice is LAB, I started wondering what the situation is today.</p>
<p>I wrote (heh) an empty trace listener for LAB and an empty appender for log4net and ran a couple of unit tests. While not nearly as dramatic as Loren Halvorson&#8217;s findings 4 years ago, the results weren&#8217;t exactly flattering from LAB&#8217;s perspective.</p>
<p>The unit tests wrote 100000 info level &#8211; not that it matters, after all we&#8217;re using empty appenders &#8211; log entries and timed the whole deal. Log4net&#8217;s effort took a respectable 153ms, while LAB&#8217;s time was a significantly longer 1396ms. I also tried actually writing the entries out, using FlatFileTraceListener and FileAppender on LAB and log4net respectively. The results: log4net 1450ms &#8211; LAB 4243ms. Not as dramatic, but relevant nevertheless.</p>
<p>Oh, and by the way, I&#8217;m not handing out a table of the dubiously conducted performance test results, because I&#8217;m mean and I want you guys to read my posts.</p>
<p>Going beyond performance, setting up LAB is &#8211; to put it gently &#8211; laborious. Microsoft&#8217;s documentation doesn&#8217;t offer configuration examples in their native xml form. Rather, they &#8220;encourage&#8221; you to use a configuration tool that is shipped with Enterprise Library. That sucks. I had to download and install Enterprise Library to use a tool to edit App.config, instead of just copying the DLL from a project I already had and modifying a copypasted configuration to suit my needs. I hate clicking around to produce stuff that&#8217;s essentially lines of code in my Visual Studio solution.</p>
<p>Then there&#8217;s the behemoth of an API that LAB sports. Constructing LogEntry objects, then asking whether it should be logged and then writing them out to the logger isn&#8217;t actually succinct. Surely you can encapsulate this behavior in your own helper methods, but I can hardly see the point in rewriting the API. Logging code should be really succinct, and by default log4net&#8217;s API provides ways to do just that.</p>
<p>log4net 1 &#8211; MS Logging Application Block 0</p>
<p>ps. Do note that Enterprise Library 3.1 is already outdated so I don&#8217;t know if these conclusions apply to Enterprise Library 4.1.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;t=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

