<?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>Sheila&#039;s Blog &#187; log4j</title>
	<atom:link href="http://sheilapollard.com/tag/log4j/feed/" rel="self" type="application/rss+xml" />
	<link>http://sheilapollard.com</link>
	<description>Software Development</description>
	<lastBuildDate>Wed, 24 Mar 2010 17:19:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Chainsaw to tail your JBoss server log</title>
		<link>http://sheilapollard.com/2009/04/07/using-chainsaw-to-tail-your-jboss-server-log/?utm_campaign=feed&utm_medium=feed&utm_source=blog</link>
		<comments>http://sheilapollard.com/2009/04/07/using-chainsaw-to-tail-your-jboss-server-log/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 11:06:21 +0000</pubDate>
		<dc:creator>Sheila</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chainsaw]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://sheilapollard.wordpress.com/?p=271</guid>
		<description><![CDATA[Log4j is a logging library from Apache.  It consists of loggers (log events) and appenders (a destination for a log message).  There&#8217;s always a rootLogger defined, plus however many other loggers you require.  A logger can have several appenders attached to it which can format and write the message to the console or a file [...]]]></description>
			<content:encoded><![CDATA[<p>Log4j is a logging library from Apache.  It consists of loggers (log events) and appenders (a destination for a log message).  There&#8217;s always a rootLogger defined, plus however many other loggers you require.  A logger can have several appenders attached to it which can format and write the message to the console or a file etc.  The logging levels are TRACE, DEBUG, INFO, WARN, ERROR and FATAL.</p>
<p>A default JBoss installation uses log4j for logging.  The log4j settings are configured in JBOSS_HOME\server\default\conf\jboss-log4j.xml which sends output to both the console and JBOSS_HOME\server\default\log\server.log</p>
<p><a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2xvZ2dpbmcuYXBhY2hlLm9yZy9jaGFpbnNhdw==" target=\"_blank\">Chainsaw</a> is a GUI tool for parsing and analysing log files generated by log4j.  It allows you to read and filter events.  It can be used to tail the server.log file allowing you to filter the messages you see rather than searching through the log file in an editor.</p>
<p>You can download Chainsaw from <a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2xvZ2dpbmcuYXBhY2hlLm9yZy9jaGFpbnNhdy9kb3dubG9hZC5odG1s" target=\"_blank\">here</a>.</p>
<p>Download the chainsawWebStart.jnlp file and open it up to start the Chainsaw Log viewer.</p>
<p><strong>Tailing a Log file</strong><br />
Create a file somewhere on your system to hold configuration information for chainsaw.</p>
<p>chainsaw-config.xml
<code>&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"&gt;

  &lt;plugin name="jboss" class="org.apache.log4j.varia.LogFilePatternReceiver"&gt;

    &lt;param name="fileURL" value="file:///c:/Applications/jboss-4.2.2.GA/server/default/log/server.log" /&gt;
    &lt;param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/&gt;
    &lt;param name="logFormat" value="TIMESTAMP LEVEL [LOGGER] MESSAGE"/&gt;
  &lt;param name="name" value="alpha-jboss" /&gt;
  &lt;param name="tailing" value="true" /&gt;
  &lt;/plugin&gt;

  &lt;root&gt;
    &lt;level value="debug"/&gt;
   &lt;root&gt;

&lt;/log4j:configuration&gt;</code></p>
<p>Edit the filename to match where the jboss server.log is on your system.</p>
<p>Select the &#8216;view-show application wide preferences&#8217; menu.</p>
<p>In the automatic configuration url field, enter the URL to your config file.<code&gt;file:///c:/chainsaw-config.xml&lt;/code><br />
Select OK and restart Chainsaw.</p>
<p>You'll see the file load up ina new tab 'file/c:Applications/jboss-4.2.2.GA/server/default/log/server.log.</p>
<p>There's a dropdown menu that lets you filter the log entries from the most verbose TRACE up to FATAL errors only.</p>
<p><strong>Chainsaw basics:</strong><br />
The toolbar icons at the top let you pause the logging, configure what gets displayed and clear the screen of events among other things.  The first thing to get accustomed to is drilling through the log events to see the information you're interested in.  In the left pane you can move through the logging tree to select a particular logger.  Any messages from a Logger matching the one selected are highlighted in black.  You can then right click on the selected logger in the tree and choose either 'Focus on' to filter to just those events or 'Ignore' to exclude them.  Selecting a specific event gives you more detailed information in the lower pane.</p>
<br /><a href="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NoZWlsYXBvbGxhcmQud29yZHByZXNzLmNvbS8/cD0yNzEjY29tbWVudHM=" title=\"Comments on &quot;Using Chainsaw to tail your JBoss server log&quot;\"><img src="http://sheilapollard.com/wp-content/plugins/feed-comments-number/image.php?271" alt="Comments" /></a> <img src="http://sheilapollard.com/wp-content/plugins/feed-statistics.php?view=1&post_id=271" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://sheilapollard.com/2009/04/07/using-chainsaw-to-tail-your-jboss-server-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
