You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by pg...@apache.org on 2001/03/05 05:52:42 UTC
cvs commit: jakarta-log4j/org/apache/log4j/examples/appserver AppServerCategory.java AppServerCategoryFactory.java AppServerLoggingEvent.java AppServerPatternLayout.java AppServerPatternParser.java package.html
pglezen 01/03/04 20:52:42
Modified: org/apache/log4j/examples/appserver AppServerCategory.java
AppServerCategoryFactory.java
AppServerLoggingEvent.java
AppServerPatternLayout.java
AppServerPatternParser.java package.html
Log:
1. Fixed some broken javadoc links in Java files of appserver package
2. Made grammatical corrections to some of the comments
3. Fixed broken links in package.html
Revision Changes Path
1.5 +18 -16 jakarta-log4j/org/apache/log4j/examples/appserver/AppServerCategory.java
Index: AppServerCategory.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/appserver/AppServerCategory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AppServerCategory.java 2001/02/03 22:39:23 1.4
+++ AppServerCategory.java 2001/03/05 04:52:38 1.5
@@ -13,32 +13,34 @@
import org.apache.log4j.spi.LoggingEvent;
/**
- * <code>AppServerCategory</code> extends <code>Category</code>
- * by adding four extra attributes relevant to applications
- * run in application servers. These attributes are
+ * Extends <a href="../../Category.html"><code>Category</code></a>
+ * by adding four text attributes
+ * relevant to applications run in application servers.
+ * These attributes are
* <p>
* <ul>
- * <li><b>host</b> - the name of the machine on which the
- * code is running
- * <li><b>server</b> - the name of the server process in which
- * the code is running
- * <li><b>component</b> - the name of the component of which
- * the code is a part
+ * <li><b>host</b> - the host on which the code is running
+ * <li><b>server</b> - the server process in which the code
+ * is running
+ * <li><b>component</b> - the component of which the code
+ * is a part
* <li><b>version</b> - the version of this code
* </ul>
* <p>This <code>Category</code> subclass generates
- * <code>AppServerLoggingEvent</code> subclasses of
- * <code>LoggingEvent</code> which include the additional
- * attributes. <code>AppServerPatternLayout</code> provides
- * the ability to format these attributes.
+ * <a href="AppServerLoggingEvent.html"><code>AppServerLoggingEvent</code></a>
+ * subclasses of
+ * <a href="../../spi/LoggingEvent.html"><code>LoggingEvent</code></a>
+ * which include the additional attributes.
+ * <a href="AppServerPatternLayout.html"><code>AppServerPatternLayout</code></a>
+ * provides the ability to format these attributes.
* <p>
* Rather than set all these attributes for each
* <code>AppServerCategory</code> instance, it is usually more
* convenient to set them on <code>AppServerCategoryFactory</code>
* and associate this factory statically with
- * <code>AppServerCategory</code> (using the static
- * <code>setFactory</code>) method. The
- * <code>AppServerCategory.getInstance(Object)</code> method can
+ * <code>AppServerCategory</code> using the static
+ * <code>setFactory</code> method. The
+ * <code>AppServerCategory.getInstance(String)</code> method can
* then be used to create <code>AppServerCategory</code>
* instances conveniently.
*
1.4 +6 -5 jakarta-log4j/org/apache/log4j/examples/appserver/AppServerCategoryFactory.java
Index: AppServerCategoryFactory.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/appserver/AppServerCategoryFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AppServerCategoryFactory.java 2001/02/03 22:39:23 1.3
+++ AppServerCategoryFactory.java 2001/03/05 04:52:39 1.4
@@ -8,11 +8,11 @@
import org.apache.log4j.spi.CategoryFactory;
/**
- * <code>AppServerCategoryFactory</code> is responsible for
- * creating correctly populated instances of
- * <code>AppServerCategory</code>. An attempt is made to
+ * Creates correctly populated instances of
+ * <a href="AppServerCategory.html"><code>AppServerCategory</code></a>.
+ * An attempt is made to
* determine the <code>hostname</code> using the
- * <code>java.net</code> API. The other three attributes
+ * <code>java.net</code> API. The other three attributes,
* <p>
* <ol>
* <li>server name
@@ -43,7 +43,8 @@
/** An identifier for this particular version/release. */
protected String version;
- /** The message bundle to be used by all categories. */
+ /** The message bundle to be used by
+ </code>AppServerCategory</code> instances. */
protected ResourceBundle messageBundle;
/**
1.3 +5 -6 jakarta-log4j/org/apache/log4j/examples/appserver/AppServerLoggingEvent.java
Index: AppServerLoggingEvent.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/appserver/AppServerLoggingEvent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AppServerLoggingEvent.java 2001/01/23 23:47:11 1.2
+++ AppServerLoggingEvent.java 2001/03/05 04:52:39 1.3
@@ -5,21 +5,20 @@
import org.apache.log4j.spi.LoggingEvent;
/**
- * The internal representation of logging events. When an affirmative
- * logging decision is made a <code>LoggingEvent</code> instance is
- * created. This instance is passed around the different log4j
- * components. This sub-class of <code>LoggingEvent</code> provides
+ * Represents logging events for application servers. When an affirmative
+ * logging decision is made, a <code>LoggingEvent</code> instance is
+ * created. This sub-class of <code>LoggingEvent</code> provides
* for a few additional attributes:
* <p>
* <ul>
- * <li>hostname of originator
+ * <li>hostname of event originator
* <li>server name of event originator
* <li>component name of event originator
* <li>component version of event originator
* </ul>
* <p>
* This class is used to add some application server related attributes
- * to those already provided by log4j. It is instanciated by
+ * to those attributes already provided by log4j. It is instanciated by
* <code>AppServerCategory.forcedLog</code> methods.
*
* @author Paul Glezen
1.3 +3 -3 jakarta-log4j/org/apache/log4j/examples/appserver/AppServerPatternLayout.java
Index: AppServerPatternLayout.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/appserver/AppServerPatternLayout.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AppServerPatternLayout.java 2001/02/21 22:28:15 1.2
+++ AppServerPatternLayout.java 2001/03/05 04:52:40 1.3
@@ -4,9 +4,9 @@
import org.apache.log4j.PatternLayout;
/**
- * This class extends <code>PatternLayout</code> to
- * create instances of <code>AppServerPatternParser</code>
- * for parsing pattern strings.
+ * Extends <code>PatternLayout</code> to create subclass
+ * instances of <code>AppServerPatternParser</code> for
+ * parsing pattern strings.
*
* @see AppServerPatternParser
* @see org.apache.log4j.helpers.PatternParser
1.2 +5 -1 jakarta-log4j/org/apache/log4j/examples/appserver/AppServerPatternParser.java
Index: AppServerPatternParser.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/appserver/AppServerPatternParser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AppServerPatternParser.java 2001/01/23 23:35:00 1.1
+++ AppServerPatternParser.java 2001/03/05 04:52:40 1.2
@@ -13,7 +13,7 @@
* <ul>
* <li>s - server name
* <li>h - hostname
- * <li>b - category name (c and C already in use)
+ * <li>b - component name (c and C already in use)
* <li>v - version name
* </ul>
* <p>
@@ -26,9 +26,13 @@
*/
public class AppServerPatternParser extends PatternParser
{
+ /** Set to 'h'.*/
protected static final char HOSTNAME_CHAR = 'h';
+ /** Set to 's'.*/
protected static final char SERVER_CHAR = 's';
+ /** Set to 'b'.*/
protected static final char COMPONENT_CHAR = 'b';
+ /** Set to 'v'.*/
protected static final char VERSION_CHAR = 'v';
/**
1.2 +23 -24 jakarta-log4j/org/apache/log4j/examples/appserver/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/appserver/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package.html 2001/01/23 23:35:00 1.1
+++ package.html 2001/03/05 04:52:40 1.2
@@ -1,27 +1,24 @@
<html>
<body>
-This package extends log4j to add extra logging attributes useful in
+This package extends log4j by adding extra logging attributes useful in
distributed application server environments. Specifically, it adds
-the following information to each logging event.
+the following text information to each logging event.
<p>
<ol>
-<li><b>host (h)</b> - the name of the machine from which the message
- was logged
-<li><b>server (s)</b> - the name of the server process from which the
- message was logged
-<li><b>component (b)</b> - the name of the component from which the
- message was logged
+<li><b>host (h)</b> - the machine from which the message was logged
+<li><b>server (s)</b> - the server process from which the message was logged
+<li><b>component (b)</b> - the component from which the message was logged
<li><b>version (v)</b> - a version string for the code from which the
message was logged
</ol>
<p>
<h3>Usage</h3>
Using this package in your programs differs little from using the
-corresponding classes from <code>org.apache.log4j</code>. At log4j
+corresponding classes in <code>org.apache.log4j</code>. At log4j
initialization you create an
instance of
<a href="AppServerCategoryFactory.html"><code>AppServerCategoryFactory</code></a>
-populated with the attributes you wish. You can either supply these
+populated with the attributes you desire. You can either supply these
in the factory's constructor
or set them afterwards. The host name is determined automatically
using the <code>java.net</code> API and can be reset manually. It
@@ -33,7 +30,7 @@
<code>AppServerCategory.setFactory</code></a> method. This
sets everything up for acquiring an
<a href="AppServerCategory.html"><code>AppServerCategory</code></a>
-reference whenever you need it.
+reference whenever you need one.
<p>
<table border=1>
<tr><td><pre>
@@ -56,36 +53,38 @@
</table>
<p>
<h3>A Note on Configurators</h3>
-Using <code>AppServerCategory</code> with the
+Using <code>AppServerCategory</code> with
<a href="../../PropertyConfigurator.html">
<code>PropertyConfigurator</code></a> or
<a href="../../xml/DOMConfigurator.html">
<code>DOMConfigurator</code></a>
-requires one note of caution. These configurators do not
-know that
+requires a note of caution. By default these configurators
+do not know that
<a href="../../Category.html"><code>Category</code></a>
has been subclassed. Upon
constructing a configuration from a set of properties, it will
-construct <code>Category</code> instances rather than the desired
-subclass. There at least two ways to work around this.
+construct <code>Category</code> instances rather than instances
+of the desired subclass. There at least two ways to work around
+this.
<p>
By instanciating any anticipated <code>AppServerCategory</code>
instances before calling a configurator, the configurator will
use the instances you create rather than trying to (incorrectly)
-create its own. The consequence of this route is that you can
+create its own. The consequence is that you can
not always predict which categories will be created. Their
dynamic nature is the reason for externalizing their configuration
-in the first place.
+in the first place. This drawback is limited to category names
+explicitly defined in the configuration.
<p>
-Another way is to take advantage of a recently added feature
+Another work-around is to take advantage of a recently added feature
allowing you to specify the type of factory used for creating
<code>Category</code> instances to a <code>DOMConfigurator</code>
-or a <code>PropertyConfigurator</code>. The consequence of this
-route is that only the default constructor is used to create
+or a <code>PropertyConfigurator</code>. The consequence
+is that only the default constructor is used to create
the factory instance. For <code>AppServerCategoryFactory</code>,
this will only populate the hostname attribute. The server name,
-component name and version name will be blank. This may be
-satisfactory for many cases.
+component name and version name will be blank. For many cases
+this may be satisfactory.
<p>
<h3>Compatibility</h3>
The log4j package naming conventions used in
@@ -97,7 +96,7 @@
in the code structure. This package may be used as a template for
specifying your own collection of attributes or extended to include
additional attributes. A
-<a href="../../../../../../doc/DeepExtension.html">log4j extension manual</a>
+<a href="../../../../../../deepExtension.html">log4j extension manual</a>
accompanies this package that will take you step by step through the
process.
</body>