Author: ataylor
Date: 2009-12-03 09:02:04 -0500 (Thu, 03 Dec 2009)
New Revision: 8523
Modified:
trunk/docs/user-manual/en/logging.xml
Log:
doc updates
Modified: trunk/docs/user-manual/en/logging.xml
===================================================================
--- trunk/docs/user-manual/en/logging.xml 2009-12-03 11:03:26 UTC (rev 8522)
+++ trunk/docs/user-manual/en/logging.xml 2009-12-03 14:02:04 UTC (rev 8523)
@@ -18,43 +18,38 @@
<!-- =============================================================================
-->
<chapter id="logging">
<title>Logging</title>
- <para>HornetQ uses standard <ulink
url="http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/"
- >JDK logging</ulink>, (a.k.a Java-Util-Logging: JUL), for all its
logging. This means we
- have no dependencies on any third party logging framework. Users can provide
their own
- logging handler to use or alternatively use the log4j handler supplied by
HornetQ.</para>
- <para>The handlers are configured via the JUL
<literal>logging.properties</literal> file. This
- default location for this file is under the <literal>lib</literal>
directory found in the
- Java home directory but it can be overridden by setting the <literal
- >java.util.logging.config.file</literal> system property to point to
the appropriate
- logging.properties file. The standalone HornetQ server does this and the
<literal
- >logging.properties</literal> file can be found under the
<literal>config</literal>
- directory of the HornetQ installation. </para>
- <para>By default the standalone server is configured to use the standard
console handler and a
- file handler that logs to
<literal>bin/logs/hornetq.log</literal>.</para>
- <para>Because some of the third party components used to bootstrap HornetQ,
i.e. the
- Microcontainer, use the JBoss Logging framework we have supplied a plugin class
that
- redirects this to the JUL logger. This is set via a system property, <literal
-
>-Dorg.jboss.logging.Logger.pluginClass=org.hornetq.integration.logging.HornetQLoggerPlugin</literal>.
- This is only needed when starting the standalone server and is set in the run
script. This
- is not a problem if you are embedding HornetQ in your own code as the
Microcontainer won't
- be being used.</para>
+ <para>HornetQ has its own Logging Delegate that has no dependencies on any
particular logging
+ framework. The default Delegate delegates all its logs to the standard <ulink
+
url="http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/"&g...
logging</ulink>,
+ (a.k.a Java-Util-Logging: JUL). By default the server picks up its JUL
configuration from a
+ <literal>logging.properties</literal> file found in the config
directories. This is
+ configured to use our own HornetQ logging formatter and will log to the console
as well as a
+ log file. For more information on configuring JUL visit Suns
website.</para>
+ <para>You can configure a different Logging Delegate programatically or via a
System
+ Property.</para>
+ <para>To do this programatically simply do the
+ following<programlisting>org.hornetq.core.logging.setDelegateFactory(new
Log4jLogDelegateFactory())</programlisting></para>
+ <para>Where <literal>Log4jLogDelegateFactory</literal> is the
implementation of <literal
+ >org.hornetq.core.logging.LogDelegateFactory </literal>that you
would like to
+ use.</para>
+ <para>To do this via a System Property simply set the property <literal
+ >org.hornetq.logger-delegate-factory-class-name</literal> to the
delegate factory being
+ used,
+
i.e.<programlisting>-Dorg.hornetq.logger-delegate-factory-class-name=org.hornetq.integration.logging.Log4jLogDelegateFactory</programlisting></para>
+ <para>As you can see in the above example HornetQ provides some Delegate
Factories for your
+ convenience. these are<orderedlist
+
><listitem><para>org.hornetq.core.logging.impl.JULLogDelegateFactory - the
+ default that uses
+
JUL.</para></listitem><listitem><para>org.hornetq.integration.logging.Log4jLogDelegateFactory
+ - which uses
Log4J</para></listitem></orderedlist></para>
<para>If you want configure your client's logging, make sure you provide a
<literal
logging.properties</literal> file and set the <literal
java.util.logging.config.file</literal> property on client startup</para>
<section>
- <title>Log4j Configuration</title>
- <para>HornetQ supplies a JUL Log4j handler that can be used instead of the
defaults if you
- prefer to work with log4j logs. To use this simply edit the
logging.properties file as
- such:</para>
-
<programlisting>handlers=org.hornetq.integration.logging.Log4jLoggerHandler</programlisting>
- <para>You will also need to download the Log4j jars and place them in the
<literal
- >lib</literal> directory and also provide a log4j configuration
and place it on the
- appropriate config directory, i.e.
<literal>config/common</literal>.</para>
- </section>
- <section>
<title>Logging With The JBoss Application Server</title>
- <para>When HornetQ is deployed within the Application Server then it will
still use JUL
- however the logging is redirected to the default JBoss logger. For more
information on
- this refer to the JBoss documentation.</para>
+ <para>When HornetQ is deployed within the JBoss Application Server version
5.x or above then
+ it will still use JUL however the logging is redirected to the default JBoss
logger. For
+ more information on this refer to the JBoss documentation. In versions before
this you
+ must specify what logger delegate you want to use.</para>
</section>
</chapter>