You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2004/02/21 01:44:00 UTC
cvs commit: avalon/logging/site/xdocs navigation.xml
mcconnell 2004/02/20 16:44:00
Modified: logging/site/xdocs/impl index.xml
logging/site/xdocs/impl/logkit index.xml
logging/site/xdocs navigation.xml
Log:
Doc updates on logkit and related targets.
Revision Changes Path
1.3 +63 -2 avalon/logging/site/xdocs/impl/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/avalon/logging/site/xdocs/impl/index.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- index.xml 13 Feb 2004 10:25:45 -0000 1.2
+++ index.xml 21 Feb 2004 00:44:00 -0000 1.3
@@ -26,13 +26,74 @@
<section name="Avalon Logging">
<subsection name="Implementation Model">
<p>
- IN PREP
+ The Avalon Logging system is defined by an API. This API declares
+ a set of interfaces for use by plugable implementations. Currently
+ we have one default plugable implementation which is based on the
+ Avalon LogKit solution.
</p>
</subsection>
<subsection name="Plugins">
+ <table>
+ <tr><th>Plugin</th><th>Description</th></tr>
+ <tr>
+ <td><a href="logkit/index.html">LogKit</a></td>
+ <td>
+ The Avalon LogKit plugin provides support for four standard log
+ targets. These include a rotating file target, a console target,
+ a multiplex target, and a plugin target. The plugin target provides
+ support for the dynamic loading of new targets based on a artifact
+ identifier.
+ </td>
+ </tr>
+ </table>
+ </subsection>
+ <subsection name="Code Example">
<p>
- IN PREP
+ The following code is an example of a application loading
+ and instantiating the Avalon Logging LogKit pluging.
</p>
+ <source>
+
+ File dir = new File( System.getProperty( "user.dir" ) );
+
+ //
+ // create an initial context
+ //
+
+ DefaultInitialContextFactory initial =
+ new DefaultInitialContextFactory( "avalon", dir );
+ initial.setCacheDirectory( getRepositoryDirectory() );
+ InitialContext context = initial.createInitialContext();
+
+ //
+ // get the plugin reference
+ //
+
+ Artifact artifact = Artifact.createArtifact(
+ "artifact:avalon-logging/avalon-logkit-impl#1.0-SNAPSHOT" );
+
+ //
+ // build the plugin
+ //
+
+ Builder builder = context.newBuilder( artifact );
+ Factory factory = builder.getFactory();
+
+ //
+ // customize the plugin to you environment
+ //
+
+ File file = new File( dir, "logging.xml" );
+ Map criteria = factory.createDefaultCriteria();
+ criteria.put( "avalon.logging.configuration", file );
+ criteria.put( "avalon.logging.basedir", dir );
+
+ //
+ // create the logging manager
+ //
+
+ LoggingManager manager = (LoggingManager) factory.create( criteria );
+ </source>
</subsection>
</section>
</body>
1.3 +125 -8 avalon/logging/site/xdocs/impl/logkit/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/avalon/logging/site/xdocs/impl/logkit/index.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- index.xml 13 Feb 2004 10:25:45 -0000 1.2
+++ index.xml 21 Feb 2004 00:44:00 -0000 1.3
@@ -24,15 +24,132 @@
</properties>
<body>
<section name="Avalon LogKit Plugin">
- <subsection name="Artifact Reference">
- <p>
- IN PREP
- </p>
+ <subsection name="Avalon Logging Logkit API">
+ The LogKit plugin defines an local API for LogKit related
+ log target factories and log targets. Through this API the
+ LogKit implementation manages a set of standard targets and
+ a target plugin framework.
</subsection>
- <subsection name="Configuration">
- <p>
- IN PREP
- </p>
+ <subsection name="Standard LogTarget">
+ <table>
+ <tr><th>Factory</th><th>Description</th></tr>
+ <tr>
+ <td>Console</td>
+ <td>
+ <p>The Console LogTarget provides support for the logging
+ of message to a console via System.out or System.err. If
+ no logging targets are defined, the implementation will
+ establish a default console target.</p>
+ <p>Example</p>
+<source><![CDATA[
+ <stream id="standard">
+ <name>System.out</name>
+ <format type="console"/>
+ </stream>
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>Rotating File</td>
+ <td>
+ <p>The rotating file target provides support for a set of
+ rotation strategies including rotation by size, rotation
+ on data, and combined date/size rotation scenarios.</p>
+ <p>Example</p>
+<source><![CDATA[
+ <file id="simple">
+ <filename>simple.log</filename>
+ <append>true</append>
+ <rotation type="revolving" init="1" max="10">
+ <size>100k</size>
+ </rotation>
+ </file>
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>Multlipex</td>
+ <td>
+ <p>The multiplex target is a target that handles the redirection
+ of a logging event to one or more log targets. This target is
+ typically used in conjuction with different filters to control
+ and qualify the information presented to different targets.
+ For example, an application my configure a console target with
+ summary warning and error reports to console, and a detailed
+ error logg with full stack trace to a rotating file target.
+ The multiplex target enabled the declaration of a single logical
+ target and the subsequent formatting and generation of log message
+ appropriate for the relative targets.</p>
+ <p>Example</p>
+<source><![CDATA[
+ <multicast id="multicast">
+ <targetref id="standard"/>
+ <targetref id="simple"/>
+ </multicast>
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>Plugin</td>
+ <td>
+ <p>The plugin target provides support for plugable log targets. A
+ typical plugin log target is defined using <target> element.</p>
+ <p>Several plugable log targets are currently available.</p>
+ <table>
+ <tr><th>Plugin</th><th>Description</th></tr>
+ <tr>
+ <td>DataGram</td>
+ <td><p>A datagram log target.<br/>
+ avalon-logging/avalon-logkit-datagram#1.0-SNAPSHOT</p>
+<source><![CDATA[
+ <target id="datagram"
+ artifact="avalon-logging/avalon-logkit-datagram#1.0-SNAPSHOT">
+ <address hostname="localhost" port="0"/>
+ </target>
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>Socket</td>
+ <td><p>A socket log target.<br/>
+ avalon-logging/avalon-logkit-socket#1.0-SNAPSHOT</p></td>
+ </tr>
+ <tr>
+ <td>Syslog</td>
+ <td><p>A syslog log target.<br/>
+ avalon-logging/avalon-logkit-syslog#1.0-SNAPSHOT</p>
+<source><![CDATA[
+ <target id="syslog"
+ artifact="avalon-logging/avalon-logkit-syslog#1.0-SNAPSHOT">
+ <address hostname="localhost" port="514" facility="USER"/>
+ <format type="extended">
+ %7.7{priority} %23.23{time:yyyy-MM-dd HH:mm:ss:SSS} [%25.25{category}] : %{message}\n%{throwable}
+ </format>
+ </target>
+]]></source>
+ </td>
+ </tr>
+ <tr>
+ <td>SMTP</td>
+ <td><p>An SMTP log target (available on request).<br/>
+ avalon-logging/avalon-logkit-smtp#1.0-SNAPSHOT</p>
+<source><![CDATA[
+ <target id="smtp"
+ artifact="avalon-logging/avalon-logkit-smtp#1.0-SNAPSHOT">
+ <to>mcconnell@osm.net</to>
+ <from>info@dpml.net</from>
+ <subject>logging target test</subject>
+ <maximum-size>1</maximum-size>
+ <session>
+ </session>
+ </target>
+]]></source>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
</subsection>
</section>
</body>
1.5 +1 -1 avalon/logging/site/xdocs/navigation.xml
Index: navigation.xml
===================================================================
RCS file: /home/cvs/avalon/logging/site/xdocs/navigation.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- navigation.xml 19 Feb 2004 08:58:04 -0000 1.4
+++ navigation.xml 21 Feb 2004 00:44:00 -0000 1.5
@@ -39,7 +39,7 @@
<menu name="Resources">
<item name="Javadoc" href="/api/index.html"/>
- <item name="Download" href="/resources/download.html"/>
+ <item name="Download" href="/download.html"/>
</menu>
<menu name="Related Projects">
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org