cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cocoon Wiki] Update of "ChainSaw" by RenaudRichardet
Date Fri, 08 Apr 2005 12:34:44 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.

The following page has been changed by RenaudRichardet:
http://wiki.apache.org/cocoon/ChainSaw

New page:
= Log Cocoon with Chainsaw v2 =

Chainsaw is a powerful GUI-based Log viewer. It's a companion application to Log4j and seems
to have replaced [wiki:LogFactorFiveHowto Log Factor 5]

See also [wiki:CocoonLog4J] and [http://logging.apache.org/log4j/docs/chainsaw.html Chainsaw
homepage]

== Getting Chainsaw v2 ==

==== Web start =====
 * you can launch Chainsaw with Web Start [http://logging.apache.org/log4j/docs/webstart/chainsaw/chainsawWebStart.jnlp
here]
 * at the startup popup, select "SocketReceiver" on "Port 4445"

==== Installing Chainsaw locally ====

 (not tested yet)

==== Note ====

One thing to note:  The Chainsaw v2 is based on the new version of log4j - 1.3 - which is
currently alpha.  Cocoon probably uses log4j 1.2.8, and SocketAppender will only work partially
between these two versions (SocketAppender sends serialized LoggingEvent objects over the
wire, and LoggingEvent changed in 1.3).

If you can log to a file, use Chainsaw to tail your log file - use a LogFilePatternReceiver
instead of a SocketReceiver.

There's an example configuration available from the Welcome tab that shows how to configure
Chainsaw to process log files (the LogFilePatternReceiver configuration section).

Copy this configuration file, change the configuration to match the location and format of
your log file, and specify the URL to this configuration file in the application-wide preferences
- configuration URL box.

When you restart Chainsaw, the log file will get processed (and if you set 'tailing' to 'true'
in the config, your file will be tailed from inside Chainsaw).

== Configuring Cocoon (using SocketAppender) ==

 * Set this properties in WEB-INF/web.xml (it's already in there, just uncomment it) :

{{{
<init-param>
  <param-name>logger-class</param-name>
<param-value>org.apache.avalon.excalibur.logger.Log4JLoggerManager</param-value>
</init-param>

<init-param>
  <param-name>log4j-config</param-name>
  <param-value>/WEB-INF/log4j.xconf</param-value>
</init-param>
}}}

 * And in WEB-INF/log4j.xconf:

{{{
<appender name="COCOON_DEFAULT"
class="org.apache.log4j.net.SocketAppender">
   <param name="RemoteHost" value="localhost" />
   <param name="Port" value="4445" />
</appender>

<root>
  <priority value ="debug" />
  <appender-ref ref="COCOON_DEFAULT" />
</root>
}}}

 * you might want to add the dtd (\src\java\org\apache\log4j\xml\log4j.dtd) to WEB-INF/

== Configuring Cocoon (using a log File) ==

 * Set this properties in WEB-INF/web.xml (same as above)

 * And in WEB-INF/log4j.xconf (should already be there):

{{{
 <appender name="COCOON_DEFAULT" class="org.apache.log4j.FileAppender">
    <param name="File"   value="${context-root}/WEB-INF/logs/log4j.log" />
    <param name="Append" value="false" />
    <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
    </layout>
</appender>

<root>
  <priority value ="debug" />
  <appender-ref ref="COCOON_DEFAULT" />
</root>
}}}

 * you might want to add the dtd (\src\java\org\apache\log4j\xml\log4j.dtd) to WEB-INF/


== Other Ressources: ==

 * http://www.codeconsult.ch/bertrand/archives/000366.html
 * http://logging.apache.org/log4j/

Mime
View raw message