<?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: 7 Good Rules to Log Exceptions</title>
	<atom:link href="http://codemonkeyism.com/7-good-rules-to-log-exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/</link>
	<description></description>
	<lastBuildDate>Sat, 13 Mar 2010 16:12:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224197</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Wed, 07 Jan 2009 19:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224197</guid>
		<description>@french_c: Oh, don&#039;t tell me about unions. I had a startup which did knowledge management by putting tags (Java, Oracle, ...) on people. Unions love that !</description>
		<content:encoded><![CDATA[<p>@french_c: Oh, don&#8217;t tell me about unions. I had a startup which did knowledge management by putting tags (Java, Oracle, &#8230;) on people. Unions love that !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: french_c</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224196</link>
		<dc:creator>french_c</dc:creator>
		<pubDate>Wed, 07 Jan 2009 18:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224196</guid>
		<description>@Bob/@Stephan:

Did you ever talk to labour unions regarding log statements? If not, and your software should run in Germany, you better do:)

Of course you need to be careful logging social, medicial or health related data. But you should also be careful logging user interaction data, which is strictly prohibited in a coporate context (in Germany). 

There might be a chance that your labour union will support user interaction tracking that can be used to benchmark employees. But if you are an employer: Better ask upfront! ;)</description>
		<content:encoded><![CDATA[<p>@Bob/@Stephan:</p>
<p>Did you ever talk to labour unions regarding log statements? If not, and your software should run in Germany, you better do:)</p>
<p>Of course you need to be careful logging social, medicial or health related data. But you should also be careful logging user interaction data, which is strictly prohibited in a coporate context (in Germany). </p>
<p>There might be a chance that your labour union will support user interaction tracking that can be used to benchmark employees. But if you are an employer: Better ask upfront! ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224195</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Wed, 07 Jan 2009 18:17:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224195</guid>
		<description>@french: Insightful comment as always, thx.</description>
		<content:encoded><![CDATA[<p>@french: Insightful comment as always, thx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: french_c</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224193</link>
		<dc:creator>french_c</dc:creator>
		<pubDate>Wed, 07 Jan 2009 17:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224193</guid>
		<description>stephan: Regarding 3bit and &quot;Don&#039;t log an rethrow&quot;.

Log and rethrow Exceptions at system borders is an interesting case. Nevertheless it is a requirement. Otherwhise you end up with a system that is perfectly healthy according to your log (and response time) while being totally broken.

At system borders I tend to log every RuntimeException including its full stack trace (at error level) and every checked exception as part of the API interaction log without a stacktrace (at info level). The &quot;API interaction log&quot; is a simple log statement that tells me which method was executed and whether the execution was successful or not.

Since most remote APIs require centralized API handling code that takes care of  exception transformation, stack trace removal, etc. it is easy to add my logging requirements.</description>
		<content:encoded><![CDATA[<p>stephan: Regarding 3bit and &#8220;Don&#8217;t log an rethrow&#8221;.</p>
<p>Log and rethrow Exceptions at system borders is an interesting case. Nevertheless it is a requirement. Otherwhise you end up with a system that is perfectly healthy according to your log (and response time) while being totally broken.</p>
<p>At system borders I tend to log every RuntimeException including its full stack trace (at error level) and every checked exception as part of the API interaction log without a stacktrace (at info level). The &#8220;API interaction log&#8221; is a simple log statement that tells me which method was executed and whether the execution was successful or not.</p>
<p>Since most remote APIs require centralized API handling code that takes care of  exception transformation, stack trace removal, etc. it is easy to add my logging requirements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224038</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Sat, 03 Jan 2009 06:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224038</guid>
		<description>@Bob: Very good comment, the same goes for passwords or (in Germany) other personal information.</description>
		<content:encoded><![CDATA[<p>@Bob: Very good comment, the same goes for passwords or (in Germany) other personal information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Follek</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224033</link>
		<dc:creator>Bob Follek</dc:creator>
		<pubDate>Fri, 02 Jan 2009 23:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224033</guid>
		<description>#2 &quot;Store Data...&quot; is excellent advice, but make sure the context info you log isn&#039;t an audit problem. In some businesses, e.g. U.S. financial services, writing a full customer account number to a log file might be a red flag. Consider using just the last 4 digits, etc.</description>
		<content:encoded><![CDATA[<p>#2 &#8220;Store Data&#8230;&#8221; is excellent advice, but make sure the context info you log isn&#8217;t an audit problem. In some businesses, e.g. U.S. financial services, writing a full customer account number to a log file might be a red flag. Consider using just the last 4 digits, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Armin</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-224014</link>
		<dc:creator>Armin</dc:creator>
		<pubDate>Fri, 02 Jan 2009 11:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-224014</guid>
		<description>Hello
it&#039;s very good
thank you sir</description>
		<content:encoded><![CDATA[<p>Hello<br />
it&#8217;s very good<br />
thank you sir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Interesting Finds: 2008.12.19~2008.12.23 - gOODiDEA.NET</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-219431</link>
		<dc:creator>Interesting Finds: 2008.12.19~2008.12.23 - gOODiDEA.NET</dc:creator>
		<pubDate>Tue, 23 Dec 2008 03:50:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-219431</guid>
		<description>[...] 7 Good Rules to Log Exceptions [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 Good Rules to Log Exceptions [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-12-21 &#171; pabloidz</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-218607</link>
		<dc:creator>links for 2008-12-21 &#171; pabloidz</dc:creator>
		<pubDate>Sun, 21 Dec 2008 12:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-218607</guid>
		<description>[...] 7 Good Rules to Log Exceptions Code Monkeyism (tags: programming) [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 Good Rules to Log Exceptions Code Monkeyism (tags: programming) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiago Fernandez</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-217081</link>
		<dc:creator>Tiago Fernandez</dc:creator>
		<pubDate>Thu, 18 Dec 2008 09:00:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-217081</guid>
		<description>@Stephan: You&#039;re right, I wasn&#039;t clear enough about that. I didn&#039;t mean to log the stack traces in the functional log, just the user exception message as you said. Cheers.</description>
		<content:encoded><![CDATA[<p>@Stephan: You&#8217;re right, I wasn&#8217;t clear enough about that. I didn&#8217;t mean to log the stack traces in the functional log, just the user exception message as you said. Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-217030</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Thu, 18 Dec 2008 05:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-217030</guid>
		<description>@Tiago: I wouldn&#039;t. I would probably log a &quot;User X entered wrong password&quot; but not the exception. There is a difference. The exception has a stacktrace and several causes. User exceptions are quite often and I don&#039;t think most organisations can handle the load of data when logging every exception.</description>
		<content:encoded><![CDATA[<p>@Tiago: I wouldn&#8217;t. I would probably log a &#8220;User X entered wrong password&#8221; but not the exception. There is a difference. The exception has a stacktrace and several causes. User exceptions are quite often and I don&#8217;t think most organisations can handle the load of data when logging every exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiago Fernandez</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216704</link>
		<dc:creator>Tiago Fernandez</dc:creator>
		<pubDate>Wed, 17 Dec 2008 21:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216704</guid>
		<description>Great post! 

Regarding #1: I agree functional and technical exceptions shouldn&#039;t be stored in the same log file, however user exceptions are useful for helping reproducing issues. IMO they should be logged to a dedicated file (e.g. functional.log).</description>
		<content:encoded><![CDATA[<p>Great post! </p>
<p>Regarding #1: I agree functional and technical exceptions shouldn&#8217;t be stored in the same log file, however user exceptions are useful for helping reproducing issues. IMO they should be logged to a dedicated file (e.g. functional.log).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216615</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Wed, 17 Dec 2008 17:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216615</guid>
		<description>@3bit: Yes, then it&#039;s the top layer. At the top layer (EJB at the remote interface or the web layer or the REST layer) you need to log and rethrow.</description>
		<content:encoded><![CDATA[<p>@3bit: Yes, then it&#8217;s the top layer. At the top layer (EJB at the remote interface or the web layer or the REST layer) you need to log and rethrow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srikanth</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216613</link>
		<dc:creator>Srikanth</dc:creator>
		<pubDate>Wed, 17 Dec 2008 16:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216613</guid>
		<description>Yes 3bit, that&#039;s an interesting case. But it should be more of an exception than a rule.</description>
		<content:encoded><![CDATA[<p>Yes 3bit, that&#8217;s an interesting case. But it should be more of an exception than a rule.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 3bit</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216603</link>
		<dc:creator>3bit</dc:creator>
		<pubDate>Wed, 17 Dec 2008 15:09:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216603</guid>
		<description>Sometimes the Anti-Pattern &quot;log and rethrow&quot; makes perfect sense. I case of EJB and remote calls you might want to log the Exception on the server side, but also the client has to be notified of the Exceptional state. If the client has no logging enabled or the log is lost, you can at least fix the server component.</description>
		<content:encoded><![CDATA[<p>Sometimes the Anti-Pattern &#8220;log and rethrow&#8221; makes perfect sense. I case of EJB and remote calls you might want to log the Exception on the server side, but also the client has to be notified of the Exceptional state. If the client has no logging enabled or the log is lost, you can at least fix the server component.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-12-17 &#171; Brent Sordyl&#8217;s Blog</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216568</link>
		<dc:creator>links for 2008-12-17 &#171; Brent Sordyl&#8217;s Blog</dc:creator>
		<pubDate>Wed, 17 Dec 2008 14:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216568</guid>
		<description>[...] 7 Good Rules to Log Exceptions &#124; Code Monkeyism 1. Only log technical exceptions not user exceptions User exceptions are either ok and need not to be logged (”login name already exists”) but shown to the user, or no exception at all (”user has no credit left”). Technical exceptions are those you need to debug (”no file storage left”, “could not book product”) and react to. If you log everything you will probably get too many log entries to have a meaningful reaction to exceptions in your log. You should inquire into every exception in your log files and find the cause for it (”is it a bug?”). Too many exceptions will make you sloppy with exceptions in your log files (”nah, just another exception”). (tags: programming exception)   Possibly related posts: (automatically generated)links for 2008-07-21Daily Bookmarks 03/26/2008Tags I: Use With Caution [...]</description>
		<content:encoded><![CDATA[<p>[...] 7 Good Rules to Log Exceptions | Code Monkeyism 1. Only log technical exceptions not user exceptions User exceptions are either ok and need not to be logged (”login name already exists”) but shown to the user, or no exception at all (”user has no credit left”). Technical exceptions are those you need to debug (”no file storage left”, “could not book product”) and react to. If you log everything you will probably get too many log entries to have a meaningful reaction to exceptions in your log. You should inquire into every exception in your log files and find the cause for it (”is it a bug?”). Too many exceptions will make you sloppy with exceptions in your log files (”nah, just another exception”). (tags: programming exception)   Possibly related posts: (automatically generated)links for 2008-07-21Daily Bookmarks 03/26/2008Tags I: Use With Caution [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique :</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216507</link>
		<dc:creator>Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique :</dc:creator>
		<pubDate>Wed, 17 Dec 2008 12:00:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216507</guid>
		<description>[...] http://www.codemonkeyism.com/archives/2008/12/16/7-good-rules-to-log-exceptions/ : 7 règles à respecter pour logger les exceptions. [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.codemonkeyism.com/archives/2008/12/16/7-good-rules-to-log-exceptions/" rel="nofollow">http://www.codemonkeyism.com/archives/2008/12/16/7-good-rules-to-log-exceptions/</a> : 7 règles à respecter pour logger les exceptions. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216037</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 16 Dec 2008 21:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216037</guid>
		<description>@Andrew: Thanks, fixed, was a newline that wordpress changed to a BR.</description>
		<content:encoded><![CDATA[<p>@Andrew: Thanks, fixed, was a newline that wordpress changed to a BR.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216031</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 16 Dec 2008 21:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216031</guid>
		<description>Good list - thanks. 

Rule #5, there&#039;s a br tag at the end of that hyperlink to OWASP... following it in firefox, it&#039;s a bad title in the wiki.</description>
		<content:encoded><![CDATA[<p>Good list &#8211; thanks. </p>
<p>Rule #5, there&#8217;s a br tag at the end of that hyperlink to OWASP&#8230; following it in firefox, it&#8217;s a bad title in the wiki.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216030</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 16 Dec 2008 21:07:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216030</guid>
		<description>@Alexey: Absolutely, you need to check your log. Lots of people don&#039;t check their logs for errors.</description>
		<content:encoded><![CDATA[<p>@Alexey: Absolutely, you need to check your log. Lots of people don&#8217;t check their logs for errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexey</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-216027</link>
		<dc:creator>Alexey</dc:creator>
		<pubDate>Tue, 16 Dec 2008 20:55:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-216027</guid>
		<description>I would add: Logging is a michanism of error hiding unless you check you log regularly. The best way to do this is to automate it.</description>
		<content:encoded><![CDATA[<p>I would add: Logging is a michanism of error hiding unless you check you log regularly. The best way to do this is to automate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srikanth</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-215901</link>
		<dc:creator>Srikanth</dc:creator>
		<pubDate>Tue, 16 Dec 2008 13:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-215901</guid>
		<description>&gt;&gt; 6. Don’t log and rethrow

I did that recently and then had to go and remove the clutter :)</description>
		<content:encoded><![CDATA[<p>&gt;&gt; 6. Don’t log and rethrow</p>
<p>I did that recently and then had to go and remove the clutter :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-215889</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 16 Dec 2008 13:28:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-215889</guid>
		<description>@Albin: I&#039;ve seen #1 several times too</description>
		<content:encoded><![CDATA[<p>@Albin: I&#8217;ve seen #1 several times too</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Albin Joseph</title>
		<link>http://codemonkeyism.com/7-good-rules-to-log-exceptions/comment-page-1/#comment-215829</link>
		<dc:creator>Albin Joseph</dc:creator>
		<pubDate>Tue, 16 Dec 2008 12:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.codemonkeyism.com/?p=442#comment-215829</guid>
		<description>I had seen so many instances of logging exceptions as you mentioned in #1 which makes debugging almost impossible. 

#2 is a new learning for me. Thanks for the tip.</description>
		<content:encoded><![CDATA[<p>I had seen so many instances of logging exceptions as you mentioned in #1 which makes debugging almost impossible. </p>
<p>#2 is a new learning for me. Thanks for the tip.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
