<?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: Logging exceptions without crufty code: a comparison of strategies</title>
	<atom:link href="http://www.summa-tech.com/blog/2009/01/07/logging-exceptions-without-crufty-code-a-comparison-of-strategies/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.summa-tech.com/blog/2009/01/07/logging-exceptions-without-crufty-code-a-comparison-of-strategies/</link>
	<description>Summa Blog</description>
	<pubDate>Fri, 12 Mar 2010 05:56:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brian Gray</title>
		<link>http://www.summa-tech.com/blog/2009/01/07/logging-exceptions-without-crufty-code-a-comparison-of-strategies/comment-page-1/#comment-2486</link>
		<dc:creator>Brian Gray</dc:creator>
		<pubDate>Wed, 10 Mar 2010 15:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.summa-tech.com/blog/?p=54#comment-2486</guid>
		<description>@Deepak thanks for sharing that link!  

If there are special cases, they'd probably be handled differently in each of these strategies.  For example, with self-logging exceptions, perhaps certain subclasses (e.g. checked exceptions in package com.foo.xyz) log themselves as warnings.  Or one of the constructors allows you to pass in a log level.  

In the end, I would look and say if some exception handling should be logged as a warning, should it really be treated as an exception?  If so, implement a special strategy.  If not, maybe use something else.</description>
		<content:encoded><![CDATA[<p>@Deepak thanks for sharing that link!  </p>
<p>If there are special cases, they&#8217;d probably be handled differently in each of these strategies.  For example, with self-logging exceptions, perhaps certain subclasses (e.g. checked exceptions in package com.foo.xyz) log themselves as warnings.  Or one of the constructors allows you to pass in a log level.  </p>
<p>In the end, I would look and say if some exception handling should be logged as a warning, should it really be treated as an exception?  If so, implement a special strategy.  If not, maybe use something else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deepak</title>
		<link>http://www.summa-tech.com/blog/2009/01/07/logging-exceptions-without-crufty-code-a-comparison-of-strategies/comment-page-1/#comment-2479</link>
		<dc:creator>Deepak</dc:creator>
		<pubDate>Thu, 04 Mar 2010 06:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.summa-tech.com/blog/?p=54#comment-2479</guid>
		<description>Sometimes you need to treat some exceptions as warnings. How this special treatment to be implemented? Also there are few don'ts in exception handling which I listing here -  http://www.myhomepageindia.com/index.php/2010/03/04/common-mistakes-in-exception-handling.html</description>
		<content:encoded><![CDATA[<p>Sometimes you need to treat some exceptions as warnings. How this special treatment to be implemented? Also there are few don&#8217;ts in exception handling which I listing here -  <a href="http://www.myhomepageindia.com/index.php/2010/03/04/common-mistakes-in-exception-handling.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://www.myhomepageindia.com/index.php/2010/03/04/common-mistakes-in-exception-handling.html');" rel="nofollow">http://www.myhomepageindia.com/index.php/2010/03/04/common-mistakes-in-exception-handling.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Gray</title>
		<link>http://www.summa-tech.com/blog/2009/01/07/logging-exceptions-without-crufty-code-a-comparison-of-strategies/comment-page-1/#comment-11</link>
		<dc:creator>Brian Gray</dc:creator>
		<pubDate>Wed, 07 Jan 2009 21:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.summa-tech.com/blog/?p=54#comment-11</guid>
		<description>That's true.  Catch all doesn't really help with that (in fact, it's the least informative of the methods), but the self-logging exceptions would allow you to pass in any info you'd like.</description>
		<content:encoded><![CDATA[<p>That&#8217;s true.  Catch all doesn&#8217;t really help with that (in fact, it&#8217;s the least informative of the methods), but the self-logging exceptions would allow you to pass in any info you&#8217;d like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Northrop</title>
		<link>http://www.summa-tech.com/blog/2009/01/07/logging-exceptions-without-crufty-code-a-comparison-of-strategies/comment-page-1/#comment-10</link>
		<dc:creator>Ben Northrop</dc:creator>
		<pubDate>Wed, 07 Jan 2009 18:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.summa-tech.com/blog/?p=54#comment-10</guid>
		<description>Great post.  

One additional disadvantage with AOP exception logging is the ability to add context to the logs.  For example, if you wanted to log the state of some class data member when an exception occurred:

&lt;code&gt;
    public class A {
        public int x;
&lt;/code&gt;
&lt;code&gt;
        public void createUser(String username) { 
            try { 
                doSomething();
            } catch(SomeException e) { 
                LOG.error("some exception when x = " + x, e);
            }
        }
    }
&lt;/code&gt;

AOP logging is sometimes "one size fits none".</description>
		<content:encoded><![CDATA[<p>Great post.  </p>
<p>One additional disadvantage with AOP exception logging is the ability to add context to the logs.  For example, if you wanted to log the state of some class data member when an exception occurred:</p>
<p><code><br />
    public class A {<br />
        public int x;<br />
</code><br />
<code><br />
        public void createUser(String username) {<br />
            try {<br />
                doSomething();<br />
            } catch(SomeException e) {<br />
                LOG.error("some exception when x = " + x, e);<br />
            }<br />
        }<br />
    }<br />
</code></p>
<p>AOP logging is sometimes &#8220;one size fits none&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
