<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 5 Common Log4J Mistakes</title>
	<atom:link href="http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/</link>
	<description>Notes by Peter Mularien on Hibernate, Spring, CSS, Java, etc.</description>
	<lastBuildDate>Sun, 18 Dec 2011 20:11:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cmeier</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-18843</link>
		<dc:creator>cmeier</dc:creator>
		<pubDate>Wed, 09 Sep 2009 17:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-18843</guid>
		<description>I once worked with an open source app where the authors had written a wrapper around log4j which made it impossible to figure out the line number and class where the actual log call was made because the line number and class logged was always the line number and class name of the wrapper!</description>
		<content:encoded><![CDATA[<p>I once worked with an open source app where the authors had written a wrapper around log4j which made it impossible to figure out the line number and class where the actual log call was made because the line number and class logged was always the line number and class name of the wrapper!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody Burleson</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-16237</link>
		<dc:creator>Cody Burleson</dc:creator>
		<pubDate>Mon, 06 Jul 2009 15:24:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-16237</guid>
		<description>I agree with Rusty that the XML configuration format is much better. For me, it is much easier to understand and to work with than the legacy properties file format. 

Though most of your readers probably understand the need to use guarded logging (e.g. if(LOG.isTraceEnabled(){...}), I believe that a revision to this post could at least be beneficial for newer developers. Unguarded logging is one of the worst offenders I have seen repeatedly in other people&#039;s code. 

Humbly, I must also add that I am guilty of at least one crime you illuminate in this article, so thanks for pointing it out! Great post!</description>
		<content:encoded><![CDATA[<p>I agree with Rusty that the XML configuration format is much better. For me, it is much easier to understand and to work with than the legacy properties file format. </p>
<p>Though most of your readers probably understand the need to use guarded logging (e.g. if(LOG.isTraceEnabled(){&#8230;}), I believe that a revision to this post could at least be beneficial for newer developers. Unguarded logging is one of the worst offenders I have seen repeatedly in other people&#8217;s code. </p>
<p>Humbly, I must also add that I am guilty of at least one crime you illuminate in this article, so thanks for pointing it out! Great post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pmularien</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-15254</link>
		<dc:creator>pmularien</dc:creator>
		<pubDate>Wed, 24 Jun 2009 03:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-15254</guid>
		<description>Thanks for the comments, Ceki - I will put that on my queue of articles to write!</description>
		<content:encoded><![CDATA[<p>Thanks for the comments, Ceki &#8211; I will put that on my queue of articles to write!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ceki Gulcu</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-15046</link>
		<dc:creator>Ceki Gulcu</dc:creator>
		<pubDate>Sun, 21 Jun 2009 09:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-15046</guid>
		<description>Hello Peter, 

The tips here apply to SLF4J (1,2,4) while 3 and 5 apply to logback. I think it would benefit the users of those projects to be aware of the pitfall you enumerate. If you could create a new post reflecting on these pitfalls as applicable using SLF4J and logback, I would gladly link to that post from our project pages.</description>
		<content:encoded><![CDATA[<p>Hello Peter, </p>
<p>The tips here apply to SLF4J (1,2,4) while 3 and 5 apply to logback. I think it would benefit the users of those projects to be aware of the pitfall you enumerate. If you could create a new post reflecting on these pitfalls as applicable using SLF4J and logback, I would gladly link to that post from our project pages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty Wright</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-14013</link>
		<dc:creator>Rusty Wright</dc:creator>
		<pubDate>Tue, 02 Jun 2009 14:21:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-14013</guid>
		<description>One of my biggest gripes with log4j is the properties format of the configuration file; this is thankfully gone with logback.  I think the xml format is much, much easier to understand.  I wish everyone would use the xml format with log4j in their examples.

Thanks for the tip about the thread name; I&#039;d taken it out long ago not realizing how useful it can be.

Another thing that can be helpful with exceptions and stack traces is Jakarta Commons Lang has an ExceptionUtils class with many helpful methods.</description>
		<content:encoded><![CDATA[<p>One of my biggest gripes with log4j is the properties format of the configuration file; this is thankfully gone with logback.  I think the xml format is much, much easier to understand.  I wish everyone would use the xml format with log4j in their examples.</p>
<p>Thanks for the tip about the thread name; I&#8217;d taken it out long ago not realizing how useful it can be.</p>
<p>Another thing that can be helpful with exceptions and stack traces is Jakarta Commons Lang has an ExceptionUtils class with many helpful methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rusty Wright</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-14012</link>
		<dc:creator>Rusty Wright</dc:creator>
		<pubDate>Tue, 02 Jun 2009 14:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-14012</guid>
		<description>I also use logback/slf4j, but for item 4, the pattern is the same.  My question has always been, why use a static since it&#039;s probably in a spring bean and there&#039;s only one instance of it anyhow?  When it&#039;s not static then you can use getClass(); e.g.,

&lt;code&gt;
private final transient Logger log = LoggerFactory.getLogger(getClass());
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I also use logback/slf4j, but for item 4, the pattern is the same.  My question has always been, why use a static since it&#8217;s probably in a spring bean and there&#8217;s only one instance of it anyhow?  When it&#8217;s not static then you can use getClass(); e.g.,</p>
<p><code>private final transient Logger log = LoggerFactory.getLogger(getClass());</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dju`</title>
		<link>http://www.mularien.com/blog/2009/06/01/5-common-log4j-mistakes/comment-page-1/#comment-13989</link>
		<dc:creator>dju`</dc:creator>
		<pubDate>Tue, 02 Jun 2009 09:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mularien.com/blog/?p=96#comment-13989</guid>
		<description>Thanks for sharing these points. I personally use SLF4J, mainly to benefit from the {} placeholders. With Spring the jcl adapter is needed.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing these points. I personally use SLF4J, mainly to benefit from the {} placeholders. With Spring the jcl adapter is needed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.238 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-01-06 13:34:40 -->

