<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: logging code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Mon, 13 Oct 2008 07:45:29 GMT</pubDate>
    <description>DZone Snippets: logging code</description>
    <item>
      <title>Log4j 101</title>
      <link>http://snippets.dzone.com/posts/show/3857</link>
      <description>// Once you have included the Log4j jar into the classpath of your&lt;br /&gt;// application, you can use the following code within each class to&lt;br /&gt;// get a logger for that class. That is, all log messages issued from&lt;br /&gt;// within that class will be tagged with the classname to make it&lt;br /&gt;// easier to locate a problem. See my tutorial on Log4j,&lt;br /&gt;// Log4j in 30 Minutes or Less (http://www.johnmunsch.com/projects/Presentations/)&lt;br /&gt;// for a better introduction.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;private static Logger log = Logger.getLogger(&lt;class name&gt;.class);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// When you need to specify the location (or a different name) for &lt;br /&gt;// the log.properties file, you can set a specific System variable&lt;br /&gt;// which Log4j will be guaranteed to read as soon as any part of&lt;br /&gt;// your code tries to use it. You do that by passing the following&lt;br /&gt;// to the JVM as you start your Java application.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;-Dlog4j.configuration=file:&lt;path to log.properties file&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 23 Apr 2007 14:43:26 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3857</guid>
      <author>JohnMunsch (John Munsch)</author>
    </item>
  </channel>
</rss>
