niclas 2004/03/29 06:47:36 Modified: . project.properties project.xml Added: buildsystem gump-build.xml maven-common-gump-build.xml project.properties site.jsl xdocs features.xml index.xml navigation.xml whitepaper.xml xdocs/style maven.css stylesheet.css tigris.css Removed: . ant.properties.sample build.xml check-targets.ent check-targets.properties forrest.properties gump-build.xml maven.xml lib .cvsignore README src/logos logkit_logo.gif src/xdocs book.xml features.xml index.xml tabs.xml whitepaper.xml Log: Made some final house-keeping, clean-up and mavenization of LogKit. Revision Changes Path 1.5 +14 -6 avalon-logkit/project.properties Index: project.properties =================================================================== RCS file: /home/cvs/avalon-logkit/project.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.properties 28 Feb 2004 11:31:23 -0000 1.4 +++ project.properties 29 Mar 2004 14:47:34 -0000 1.5 @@ -19,12 +19,20 @@ # ------------------------------------------------------------------- # P R O J E C T P R O P E R T I E S # ------------------------------------------------------------------- -maven.repo.remote = http://lsd.student.utwente.nl/repository,http://www.apache.org/dist/avalon,http://www.ibiblio.org/maven +maven.repo.remote = http://www.apache.org/dist/avalon,http://www.ibiblio.org/maven maven.junit.fork = yes -# location of the build system -avalon.base = ${basedir}/../avalon -avalon.buildsystem = ${avalon.base}/buildsystem -parent.project.home = ${avalon.base} + +# maven.license.licenseFile = ${basedir}/LICENSE.txt +# maven.ui.banner.background = #fff +# maven.ui.banner.foreground = #000 +maven.xdoc.poweredby.image = +maven.xdoc.jsl=file:${basedir}/buildsystem/site.jsl +maven.docs.src=${basedir}/xdocs/ +maven.javadoc.stylesheet = ${basedir}/xdocs/style/stylesheet.css + +sun.j2se.link = http://java.sun.com/j2se/1.4/docs/api/ +framework.api.link = http://avalon.apache.org/framework/api/ +maven.javadoc.links = ${sun.j2se.link},${framework.api.link} # gump integration -project.name=logkit +project.name=avalon-logkit 1.13 +160 -25 avalon-logkit/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-logkit/project.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- project.xml 28 Mar 2004 18:52:39 -0000 1.12 +++ project.xml 29 Mar 2004 14:47:34 -0000 1.13 @@ -16,20 +16,24 @@ limitations under the License. --> <project> - <extend>${avalon.buildsystem}/project-common.xml</extend> - - <name>Avalon-LogKit</name> + <name>Avalon LogKit</name> <id>avalon-logkit</id> <groupId>avalon-logkit</groupId> <currentVersion>2.0</currentVersion> <inceptionYear>2003</inceptionYear> - <shortDescription>The Avalon-LogKit logging utility</shortDescription> + + <shortDescription>The Avalon LogKit logging utility</shortDescription> <description> Avalon LogKit is the logging utility used by default in all Avalon systems. </description> <package>org.apache.log</package> - + + <repository> + <connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:avalon-logkit</connection> + <url>http://cvs.apache.org/viewcvs/avalon-logkit/</url> + </repository> + <dependencies> <dependency> <id>log4j</id> @@ -53,25 +57,156 @@ <artifactId>jms</artifactId> <version>1.1</version> </dependency> - - <!-- Forrest Deps --> - <dependency> - <id>xml-apis</id> - <version>2.0.2</version> - </dependency> - <dependency> - <id>xercesImpl</id> - <version>2.4.0</version> - <groupId>xerces</groupId> - </dependency> - <dependency> - <id>xmlParserAPIs</id> - <version>2.2.1</version> - <groupId>xerces</groupId> - </dependency> - <dependency> - <id>xalan</id> - <version>2.5.1</version> - </dependency> </dependencies> + + <organization> + <name>The Apache Software Foundation</name> + <url>http://avalon.apache.org/</url> + <logo>http://avalon.apache.org/images/apache-avalon-logo.png</logo> + </organization> + <gumpRepositoryId>avalon-logkit</gumpRepositoryId> + + <mailingLists> + <mailingList> + <name>Avalon Developer List</name> + <subscribe>[EMAIL PROTECTED]</subscribe> + <unsubscribe>[EMAIL PROTECTED]</unsubscribe> + <archive>http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]</archive> + </mailingList> + <mailingList> + <name>Avalon User List</name> + <subscribe>[EMAIL PROTECTED]</subscribe> + <unsubscribe>[EMAIL PROTECTED]</unsubscribe> + <archive>http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]</archive> + </mailingList> + <mailingList> + <name>CVS List</name> + <subscribe>[EMAIL PROTECTED]</subscribe> + <unsubscribe>[EMAIL PROTECTED]</unsubscribe> + </mailingList> + </mailingLists> + + <developers> + <developer> + <name>Stephen McConnell</name> + <id>mcconnell</id> + <email>[EMAIL PROTECTED]</email> + </developer> + <developer> + <name>Leo Simons</name> + <id>leosimons</id> + <email>[EMAIL PROTECTED]</email> + </developer> + <developer> + <name>Berin Loritsch</name> + <id>bloritsch</id> + <email>[EMAIL PROTECTED]</email> + </developer> + <developer> + <name>Peter Royal</name> + <id>proyal</id> + <email>[EMAIL PROTECTED]</email> + </developer> + <developer> + <name>Aaron Far</name> + <email>[EMAIL PROTECTED]</email> + <id>farra</id> + <organization>Sony Electronics</organization> + </developer> + <developer> + <name>Alex Karasulu</name> + <email>[EMAIL PROTECTED]</email> + <id>akarasulu</id> + </developer> + <developer> + <name>Niclas Hedhman</name> + <email>[EMAIL PROTECTED]</email> + <id>niclas</id> + </developer> + </developers> + + <build> + + <nagEmailAddress>dev@avalon.apache.org</nagEmailAddress> + <sourceDirectory>${basedir}/src/java</sourceDirectory> + <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory> + <integrationUnitTestSourceDirectory/> + <aspectSourceDirectory/> + + <unitTest> + <includes> + <include>**/*TestCase*</include> + </includes> + <excludes> + <exclude>**/Abstract*</exclude> + </excludes> + <resources> + <resource> + <directory>${basedir}/src/test</directory> + <includes> + <include>**/*.dtd</include> + <include>**/*.properties</include> + <include>**/*.xinfo</include> + <include>**/*.xtype</include> + <include>**/*.xprofile</include> + <include>**/*.xconfig</include> + <include>**/*.xml</include> + <include>**/*.xservice</include> + <include>**/*.mf</include> + <include>**/*.jar</include> + </includes> + </resource> + <resource> + <directory>${maven.conf.dir}</directory> + <includes> + <include>**/*.properties</include> + </includes> + </resource> + <resource> + <directory>${basedir}/src/test/conf</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + </unitTest> + + <integrationUnitTestPatterns></integrationUnitTestPatterns> + + <resources> + <resource> + <directory>${basedir}/src/java</directory> + <includes> + <include>**/*.dtd</include> + <include>**/*.properties</include> + <include>**/*.xinfo</include> + <include>**/*.xtype</include> + <include>**/*.xprofile</include> + <include>**/*.xconfig</include> + <include>**/*.xml</include> + <include>**/*.xservice</include> + </includes> + </resource> + <resource> + <directory>${basedir}/../</directory> + <includes> + <include>LICENSE.txt</include> + </includes> + </resource> + <resource> + <directory>${maven.conf.dir}</directory> + <targetPath>BLOCK-INF</targetPath> + <includes> + <include>block.xml</include> + </includes> + </resource> + </resources> + + <jars></jars> + </build> + + <reports> + <report>maven-javadoc-plugin</report> + </reports> + </project> 1.1 avalon-logkit/buildsystem/gump-build.xml Index: gump-build.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project default="warning" name="Gump Build Support - DO NOT HAND-EDIT!!!" basedir="."> <property file="${basedir}/project.properties"></property> <target name="need-for-common-build" unless="avalon.buildsystem.available"> <fail> =================================================================== BUILD SYSTEM FAILURE! =================================================================== a required file, ${avalon.buildsystem}/maven-common-gump-build.xml, cannot be found. Try setting the avalon.buildsystem property in project.properties to the correct location. </fail> </target> <target name="delegate"> <available file="${avalon.buildsystem}/maven-common-gump-build.xml" property="avalon.buildsystem.available"></available> <antcall target="need-for-common-build"></antcall> <ant inheritRefs="true" target="avalon:${target}" antfile="${avalon.buildsystem}/maven-common-gump-build.xml" inheritAll="true"></ant> </target> <target name="warning"> <antcall target="delegate"> <param name="target" value="warning"></param> </antcall> </target> <target name="jar"> <antcall target="delegate"> <param name="target" value="jar"></param> </antcall> </target> <target name="javadocs"> <antcall target="delegate"> <param name="target" value="javadocs"></param> </antcall> </target> <target name="dist"> <antcall target="delegate"> <param name="target" value="dist"></param> </antcall> </target> </project> 1.1 avalon-logkit/buildsystem/maven-common-gump-build.xml Index: maven-common-gump-build.xml =================================================================== <?xml version="1.0"?> <!-- this ant buildfile provides base functionality for gump integration. You should not normally have to modify this by hand. --> <project name="Gump Build Support" default="warning" basedir="."> <!-- note the lack of property file inclusion. You should do that from the script which calls this file. --> <target name="avalon:warning" unless="do.not.warn"> <echo> ======================================================================= WARNING! This buildfile is only here for gump integration. Please use maven (http://maven.apache.org/) for normal builds. ======================================================================= </echo> </target> <target name="avalon:debug" unless="do.not.debug"> <echo> ======================================================================= DEBUG INFO maven.src.dir = ${maven.src.dir} maven.build.dir = ${maven.build.dir} maven.compile.debug = ${maven.compile.debug} maven.compile.deprecation = ${maven.compile.deprecation} maven.compile.optimize = ${maven.compile.optimize} project.name = ${project.name} project.version = ${project.version} project.copyright.year = ${project.copyright.year} java sources = ${maven.src.dir}/java java classes = ${maven.build.dir}/classes jarfile = ${maven.build.dir}/${project.name}-${project.version}.jar javadocs = ${maven.build.dir}/docs/apidocs junitreports = ${maven.build.dir}/docs/junitreports ======================================================================= </echo> </target> <target name="avalon:warn-project.name" unless="project.name.set"> <echo> ======================================================================= WARNING! The property 'project.name' has not been set. This will result in a jar file with a rather dumb name, being ${maven.build.dir}/${project.name}-${project.version}.jar To fix this, add a property to the gump build definition or the properties file for the current component. ======================================================================= </echo> </target> <target name="avalon:warn-avail-test-src" unless="test.src.present"> <echo> ======================================================================= NOTE! The directory ${maven.src.dir}/test does not exist. This means no unit tests will be run. ======================================================================= </echo> </target> <target name="avalon:warn-avail-no-sources" if="no.sources.available"> <fail> ======================================================================= ERROR! This project does not contain any java source files in ${maven.src.dir}/java or ${maven.src.dir}/test or that means it is not possible to generate any classes, jars or javadocs. ======================================================================= </fail> </target> <target name="avalon:warn-avail"> <antcall target="avalon:warn-avail-no-sources"/> <antcall target="avalon:warn-avail-test-src"/> </target> <target name="avalon:init"> <echo> ======================================================================= Build initialization using /avalon/buildsystem/maven-common-gump-build.xml ======================================================================= </echo> <antcall target="avalon:warning"/> <antcall target="avalon:debug"/> <!-- defaults --> <property name="maven.src.dir" value="${basedir}/src"/> <property name="maven.build.dir" value="${basedir}/target"/> <property name="maven.compile.debug" value="on"/> <property name="maven.compile.optimize" value="off"/> <property name="maven.compile.deprecation" value="off"/> <property name="maven.junit.fork" value="off"/> <property name="maven.junit.dir" value="${basedir}"/> <property name="maven.junit.usefile" value="true"/> <property name="project.name" value="some-nameless-gump-built-component"/> <tstamp> <format property="project.version" pattern="yyyyMMdd"/> </tstamp> <property name="project.copyright.year" value="1997-2003"/> <condition property="project.name.set"> <isset property="project.name"/> </condition> <antcall target="avalon:warn-project.name"/> <available file="${basedir}/src/java" property="java.src.present"/> <available file="${basedir}/src/test" property="test.src.present"/> <condition property="no.sources.available"> <and> <not><isset property="java.src.present"/></not> <not><isset property="test.src.present"/></not> </and> </condition> <antcall target="avalon:warn-avail"/> </target> <target name="avalon:jar" depends="avalon:init, avalon:java-compile, avalon:test, avalon:regular-jar"/> <target name="avalon:java-compile" if="java.src.present" depends="avalon:init"> <echo> ======================================================================= Compiling Sources ======================================================================= </echo> <mkdir dir="${maven.build.dir}"/> <mkdir dir="${maven.build.dir}/classes"/> <javac destdir="${maven.build.dir}/classes" excludes="**/package.html" debug="${maven.compile.debug}" deprecation="${maven.compile.deprecation}" optimize="${maven.compile.optimize}"> <src> <pathelement path="${maven.src.dir}/java"/> </src> </javac> <mkdir dir="${maven.build.dir}/src"/> <copy todir="${maven.build.dir}/src"> <fileset dir="${maven.src.dir}/java"/> </copy> </target> <target name="avalon:test" if="test.src.present" depends="avalon:init,avalon:java-compile"> <echo> ======================================================================= Compiling Tests ====================================================================== </echo> <mkdir dir="${maven.build.dir}/test-classes"/> <mkdir dir="${maven.build.dir}/classes"/> <!-- copy resource from the src/test to the target/test-classes directory --> <copy todir="${maven.build.dir}/test-classes"> <fileset dir="${maven.src.dir}/test"> <exclude name="**/*.java"/> <exclude name="**/package.html"/> </fileset> </copy> <javac destdir="${maven.build.dir}/test-classes" excludes="**/package.html" debug="${maven.compile.debug}" deprecation="${maven.compile.deprecation}" optimize="${maven.compile.optimize}"> <src> <pathelement path="${maven.src.dir}/test"/> </src> <classpath> <pathelement path="${maven.build.dir}/classes"/> </classpath> </javac> <echo> ======================================================================= Running tests ======================================================================= </echo> <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/> <mkdir dir="${maven.build.dir}/test-reports"/> <junit printSummary="yes" failureProperty="maven.test.failure" fork="${maven.junit.fork}" dir="${maven.junit.dir}"> <sysproperty key="basedir" value="${basedir}"/> <formatter type="xml"/> <formatter type="plain" usefile="${maven.junit.usefile}"/> <classpath> <pathelement location="${maven.build.dir}/classes"/> <pathelement location="${maven.build.dir}/test-classes"/> </classpath> <batchtest todir="${maven.build.dir}/test-reports"> <fileset dir="${maven.src.dir}/test"> <include name="**/*TestCase.java"/> <exclude name="**/*Abstract*"/> </fileset> </batchtest> </junit> <echo> ======================================================================= Generating test reports ======================================================================= </echo> <!-- note: this completely deviates from the approach maven takes to generating the junit reports and stores them in a different location. --> <mkdir dir="${maven.build.dir}/docs/junitreports"/> <junitreport todir="${maven.build.dir}/docs/junitreports"> <fileset dir="${maven.build.dir}/test-reports"> <include name="TEST-*.xml"/> </fileset> <report format="frames" todir="${maven.build.dir}/docs/junitreports"/> </junitreport> </target> <target name="avalon:regular-jar" depends="avalon:init,avalon:java-compile"> <echo> ======================================================================= Building jar ======================================================================= </echo> <mkdir dir="${maven.build.dir}/classes"/> <jar destfile="${maven.build.dir}/${project.name}-${project.version}.jar" basedir="${maven.build.dir}/classes"/> </target> <target name="avalon:javadocs" depends="avalon:init,avalon:jar"> <mkdir dir="${maven.build.dir}/docs"/> <mkdir dir="${maven.build.dir}/docs/apidocs"/> <mkdir dir="${maven.build.dir}/classes"/> <property name="copyright" value="Copyright &copy; ${project.copyright.year} Apache Software Foundation. All Rights Reserved." /> <property name="title" value="Avalon ${project.name} API"/> <javadoc sourcepath="${maven.build.dir}/src" packagenames="org.apache.*" destdir="${maven.build.dir}/docs/apidocs" windowtitle="${title}" doctitle="${title}" bottom="${copyright}"> <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/> <link href="http://avalon.apache.org/framework/api/"/> <classpath> <path location="${maven.build.dir}/classes"/> </classpath> </javadoc> </target> <target name="avalon:distclean"> <delete dir="${maven.build.dir}/${project.name}-${project.version}"/> <delete dir="${maven.build.dir}/dist"/> </target> <target name="avalon:dist" depends="avalon:init,avalon:distclean,avalon:jar,avalon:javadocs"> <mkdir dir="${maven.build.dir}"/> <mkdir dir="${maven.build.dir}/${project.name}-${project.version}"/> <mkdir dir="${maven.build.dir}/dist"/> <echo> ======================================================================= Building Binary Distribution ======================================================================= </echo> <mkdir dir="${maven.build.dir}/${project.name}-${project.version}/bin"/> <copy todir="${maven.build.dir}/${project.name}-${project.version}/bin"> <fileset dir="${maven.build.dir}"> <include name="*.jar"/> <include name="*.txt"/> <include name="*.zip"/> <include name="docs"/> </fileset> </copy> <zip destfile="${maven.build.dir}/dist/${project.name}-${project.version}-bin.zip"> <zipfileset dir="${maven.build.dir}/${project.name}-${project.version}/bin" prefix="${project.name}-${project.version}"/> </zip> <echo> ======================================================================= Building Source Distribution ======================================================================= </echo> <mkdir dir="${maven.build.dir}/${project.name}-${project.version}/src"/> <copy todir="${maven.build.dir}/${project.name}-${project.version}/src"> <fileset dir="${maven.src.dir}"/> <fileset dir="${maven.build.dir}"> <include name="*.txt"/> </fileset> <fileset dir="${basedir}"> <include name="README*"/> <include name="LICENSE*"/> <include name="maven.*"/> <include name="project.*"/> </fileset> </copy> <zip destfile="${maven.build.dir}/dist/${project.name}-${project.version}-src.zip"> <zipfileset dir="${maven.build.dir}/${project.name}-${project.version}/src" prefix="${project.name}-${project.version}"/> </zip> </target> </project> 1.1 avalon-logkit/buildsystem/project.properties Index: project.properties =================================================================== # # Copyright 2004 The Apache Software Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # # See the License for the specific language governing permissions and # limitations under the License. # # # ------------------------------------------------------------------- # P R O J E C T P R O P E R T I E S # ------------------------------------------------------------------- avalon.build.system=${basedir} 1.1 avalon-logkit/buildsystem/site.jsl Index: site.jsl =================================================================== <?xml version="1.0"?> <!-- stylesheet to be used --> <jsl:stylesheet select="$doc" xmlns:define="jelly:define" xmlns:j="jelly:core" xmlns:jsl="jelly:jsl" xmlns:log="jelly:log" xmlns:util="jelly:util" xmlns:x="jelly:xml" xmlns:doc="doc" xmlns="dummy" trim="false"> <jsl:template match="document" trim="false"> <j:useBean var="navbean" class="org.apache.maven.NavBean"/> <j:set var="location" value="${outFile.substring(destdir.length())}"/> <util:replace var="location" oldChar="\" newChar="/" value="${location}"/> <!-- Stores location for publish date / version --> <j:set var="date">${maven.xdoc.date}</j:set> <j:setProperties object="${navbean}" document="${doc}" location="${location}"/> <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> <html> <head> <j:set var="docTitle"> <x:expr select="./properties/title"/> </j:set> <x:if select="$nav/title"> <title> <x:expr select="$nav/title"/> - ${docTitle} </title> </x:if> <x:if select="not($nav/title)"> <title>${pom.name} - ${docTitle}</title> </x:if> <style type="text/css"><![CDATA[ @import url("${relativePath}/style/tigris.css"); @import url("${relativePath}/style/maven.css"); ]]></style> <util:file var="projectCssFile" name="${maven.docs.src}/style/project.css"/> <j:if test="${projectCssFile.exists()}"> <style type="text/css"><![CDATA[ @import url("${relativePath}/style/project.css"); ]]></style> </j:if> <!-- FIXME: once someone works out how to stop this breaking <x:element name="script"><x:attribute name="type">text/javascript</x:attribute> if (document.layers) { document.writeln(''+ '<link rel="stylesheet" type="text/css" href="${relativePath}/style/ns4_only.css" media="screen" /><link rel="stylesheet" type="text/css" href="${relativePath}/style/maven_ns4_only.css" media="screen"/>'); } </x:element> --> <link rel="stylesheet" type="text/css" href="${relativePath}/style/print.css" media="print"/> <meta http-equiv="Content-Type" content="text/html; charset=${outputencoding}"></meta> <x:forEach var="author" select="./properties/author"> <meta name="author" content="${author.text}"/> <meta name="email" content="${author.attribute('email').value}"/> </x:forEach> <jsl:applyTemplates select="$doc/document/head/*"/> </head> <x:element name="body"><j:whitespace trim="true"> <x:attribute name="class">composite</x:attribute> <x:forEach var="attr" select="$doc/document/body/@*"> <x:attribute name="${attr.name}">${attr.value}</x:attribute> </x:forEach> </j:whitespace> <div id="banner"> <table border="0" cellspacing="0" cellpadding="8" width="100%" height="103"> <tr> <!-- organization logo --> <td> <j:set var="logo" value="${pom.organization.logo}"/> <j:if test="${!empty(logo)}"> <!-- set url to org or project url --> <j:set var="url" value="${pom.organization.url}"/> <j:if test="${!empty(url)}"> <j:set var="home" value="${pom.organization.url}"/> </j:if> <j:if test="${empty(url)}"> <j:set var="home" value="${pom.url}"/> </j:if> <!-- set image to relative or complete --> <j:set var="image" value="${pom.organization.logo}"/> <j:if test="${!image.startsWith('http://')}"> <j:set var="image" value="${relativePath}${image}"/> </j:if> <a href="${home}"> <img src="${image}" align="left" alt="${pom.organization.name}" border="0"/> </a> </j:if> </td> <td></td> <!-- <td> <div align="right" id="login"> <j:set var="logo" value="${pom.logo}"/> <j:if test="${logo != null and logo != ''}"> <j:set var="image" value="${pom.logo}"/> <j:if test="${!image.startsWith('http://')}"> <j:set var="image" value="${relativePath}${image}"/> </j:if> <a href="${pom.url}"> <img src="${image}" align="right" alt="${pom.name}" border="0"/> </a> </j:if> </div> </td> --> </tr> </table> </div> <div id="breadcrumbs"> <table border="0" cellspacing="0" cellpadding="4" width="100%"> <tr> <j:if test="${date == 'left'}"> <j:set var="version" value="${maven.xdoc.version}"/> <td>Last published: ${build.date} <j:if test="${!empty(version)}">| Doc for ${version}</j:if> </td> </j:if> <td> <div align="right"> <j:if test="${date == 'right'}"> Last published: ${build.date} <x:if select="$nav/body/links">|</x:if> </j:if> <!-- render links --> <x:if select="$nav/body/links"> <jsl:applyTemplates select="$nav/body/links"/> </x:if> <x:if select="not($nav/body/links)"> <!-- FIXME --> </x:if> </div> </td> </tr> </table> </div> <!-- Body of the page --> <table border="0" cellspacing="0" cellpadding="8" width="100%"> <!--id="main" --> <tr valign="top"> <td id="leftcol" width="20%"> <div id="navcolumn"> <j:if test="${date == 'navigation-top'}"> <div> <small>Last published: ${build.date}</small> </div> </j:if> <x:if select="$nav"> <jsl:applyTemplates select="$nav/body/menu[not(@type) | @type='header'] | $nav/body/search"/> </x:if> <!-- Standard Maven Navigation --> <j:set var="fileName">${file}</j:set> <!-- ! Check to see if the user wishes to include the ! maven-generated docs on their site. !--> <j:if test="${includeProjectDocumentation.equals('yes')}"> <div> <strong>Project Documentation</strong> <!-- <div> <small> <a href="${relativePath}/index.html">About ${pom.name}</a> </small> </div> --> <div> <small> <a href="${relativePath}/project-info.html">Project Info</a> </small> <util:tokenize var="projectInfoFiles" delim=",">${maven.xdoc.projectInfo}</util:tokenize> <j:forEach var="infoFile" items="${projectInfoFiles}"> <j:if test="${relativePath == '.' and fileName.endsWith(infoFile)}"> <div> <small> <a href="${relativePath}/mail-lists.html">Mailing Lists</a> </small> </div> <div> <small> <a href="${relativePath}/team-list.html">Project Team</a> </small> </div> <div> <small> <a href="${relativePath}/dependencies.html">Dependencies</a> </small> </div> <j:if test="${!empty(pom.repository.url)}"> <div> <small> <a href="${relativePath}/cvs-usage.html">Source Repository</a> </small> </div> </j:if> <j:if test="${!empty(pom.issueTrackingUrl)}"> <div> <small> <a href="${relativePath}/issue-tracking.html">Issue Tracking</a> </small> </div> </j:if> </j:if> </j:forEach> </div> <div> <small> <a href="${relativePath}/maven-reports.html">Project Reports</a> </small> <!-- | Check to see if we need to include the report | links in this document. The only time we | need to do this is when the current document | either the maven-reports.xml doc (the page | is displayed when clicking on Project | Reports) or when the current document is one | of the actual reports (in which case we want | to leave the project report links expanded. |--> <j:set var="includeReportLinks" value="false"/> <j:forEach var="report" items="${reports}"> <j:set var="linkWithXmlExt" value="${report.link}.xml"/> <j:if test="${relativePath == '.' and (fileName.endsWith('maven-reports.xml') or fileName.endsWith(linkWithXmlExt))}"> <j:set var="includeReportLinks" value="true"/> </j:if> </j:forEach> <!-- | If we need to include the report links, then | do so. This is determined by the above | block. |--> <j:if test="${includeReportLinks == 'true'}"> <j:forEach var="report" items="${reports}"> <div> <small> <a href="${relativePath}/${report.link}.html"> ${report.name} </a> </small> </div> </j:forEach> </j:if> </div> <j:if test="${pom.reports.isEmpty()}"> <j:if test="${sourcesPresent}"> <div> <small> <a href="${relativePath}/apidocs/index.html">JavaDocs</a> </small> </div> <div> <small> <a href="${relativePath}/xref/index.html">Source XReference</a> </small> </div> <j:if test="${unitTestSourcesPresent == 'true'}"> <div> <small> <a href="${relativePath}/xref-test/index.html">Test XReference</a> </small> </div> </j:if> </j:if> </j:if> <!-- <j:set var="devProcess" value="false"/> <util:available file="${maven.docs.src}/development-process.xml"> <j:set var="devProcess" value="true"/> </util:available> <j:if test="${devProcess}"> <div> <small> <a href="${relativePath}/development-process.html">Development Process</a> </small> </div> </j:if> <j:if test="${!devProcess}"> <div> <small> <j:set var="devProcess">${maven.xdoc.developmentProcessUrl}</j:set> <a href="${devProcess}">Development Process</a> </small> </div> </j:if> --> </div> </j:if> <j:set var="poweredbyimage">${maven.xdoc.poweredby.image}</j:set> <j:set var="poweredbytitle">${maven.xdoc.poweredby.title}</j:set> <j:set var="poweredbyurl">${maven.xdoc.poweredby.url}</j:set> <j:if test="${!empty(poweredbyimage)}"> <div style="margin-top: 20px; width: 100%; text-align: center;"> <a href="${poweredbyurl}" title="${poweredbytitle}"><img alt="${maven.xdoc.poweredby.title}" style="border: 1px solid black" src="${relativePath}/images/logos/${poweredbyimage}"/></a> </div> </j:if> <j:if test="${date == 'navigation-bottom'}"> <div> <small>Last published: ${build.date}</small> </div> </j:if> </div> </td> <td rowspan="2"> <div id="bodycol"> <!-- Insert MAIN body here --> <div class="app"> <!-- FIXME really shouldn't use $doc, but jelly loses it's context again --> <jsl:applyTemplates select="$doc/document/body/section"/> <jsl:applyTemplates select="$doc/document/body/glossary" /> <jsl:applyTemplates select="$doc/document/body/release" /> <jsl:applyTemplates select="$doc/document/body/changelog" /> <jsl:applyTemplates select="$doc/document/body/taskList" /> <jsl:applyTemplates select="$doc/document/body/goals" /> </div> </div> </td> </tr> </table> <div id="footer"> <table style='width:100%' border="0" cellspacing="0" cellpadding="4"> <jsl:applyTemplates select="$nav/body/footer"/> <tr> <td> <j:if test="${!empty(pom.organization.name)}"> <j:if test="${!empty(pom.inceptionYear)}"> <j:if test="${pom.inceptionYear == mavenCurrentYear}"> © ${mavenCurrentYear}, ${pom.organization.name} </j:if> <j:if test="${pom.inceptionYear != mavenCurrentYear}"> © ${pom.inceptionYear}-${mavenCurrentYear}, ${pom.organization.name} </j:if> </j:if> <j:if test="${empty(pom.inceptionYear)}"> © ${mavenCurrentYear}, ${pom.organization.name} </j:if> </j:if> <j:if test="${date == 'bottom'}"> - Last published: ${build.date} </j:if> </td> <j:if test="${date == 'bottom-right'}"> <td style='width: auto; text-align:right'>Last published: ${build.date}</td> </j:if> </tr> </table> </div> </x:element> </html> </jsl:template> <!-- process the properties of the doc --> <jsl:template match="properties" trim="false"> <!-- stick head block here later --> </jsl:template> <!-- Process a menu for the navigation bar --> <jsl:template match="menu" trim="false"> <div> <strong><x:expr select="@name"/></strong> <jsl:applyTemplates select="item"/> </div> </jsl:template> <jsl:template match="item" trim="false"> <x:set var="item" select="."/> <x:set var="_name" select="string(@name)"/> <x:set var="_link" select="string(@href)"/> <x:set var="_img" select="string(@img)"/> <div> <small> <j:if test="${navbean.isSelected(item.get(0))}"> <b><doc:itemLink name="${_name}" link="${_link}" img="${_img}"/></b> </j:if> <j:if test="${!navbean.isSelected(item.get(0))}"> <doc:itemLink name="${_name}" link="${_link}" img="${_img}"/> </j:if> </small> <j:if test="${!navbean.isCollapsed(item.get(0))}"> <jsl:applyTemplates select="item"/> </j:if> </div> </jsl:template> <!-- Process the breadcrumb navbar --> <jsl:template match="links" trim="false"> <j:set var="linkCount" value="1"/> <x:forEach var="link" select="item"> <j:if test="${linkCount != 1}">|</j:if> <j:set var="_name"><x:expr select="@name"/></j:set> <j:set var="_link"><x:expr select="@href"/></j:set> <doc:itemLink name="${_name}" link="${_link}"/> <j:set var="linkCount" value="${1+linkCount}"/> </x:forEach> </jsl:template> <!-- Google site search --> <jsl:template match="search" trim="false"> <!-- Search code: http://www.google.com/searchcode.html --> <!-- Google logos: http://www.google.com/stickers.html --> <!-- Terms: http://www.google.com./services/terms_free.html --> <div> <strong>Search ${pom.name}</strong> <form method="get" action="http://www.google.com/search"> <a class="navlink" href="http://www.google.com"> <img src="http://www.google.com/logos/Logo_25wht.gif" alt="Google" border="0" /> </a><p/> <j:set var="siteURL" value="${pom.url}"/> <!-- google fails on urls that end with / --> <j:if test="${siteURL.endsWith('/')}"> <j:set var="URLLength" value="${siteURL.length() - 1}"/> <j:set var="siteURL" value="${siteURL.substring(0, URLLength.intValue())}"/> </j:if> <input type="text" size="15" name="q" maxlength="255" value=""/> <input type="submit" value="Go" name="btnG"/> <input type="hidden" name="domains" value="${siteURL}"/> <input type="hidden" id="search" name="sitesearch" value="${siteURL}"/> </form> </div> </jsl:template> <!-- process a documentation section --> <jsl:template match="section" trim="false"> <div class="h3"> <j:set var="_sectionName"><x:expr select="@name"/></j:set> <j:if test="${!empty(_sectionName)}"> <h3> <a name="${_sectionName}">${_sectionName}</a> </h3> </j:if> <jsl:applyTemplates select="*"/> </div> </jsl:template> <jsl:template match="subsection" trim="false"> <div class="h4"> <j:set var="_sectionName"><x:expr select="@name"/></j:set> <j:if test="${!empty(_sectionName)}"> <h4> <a name="${_sectionName}">${_sectionName}</a> </h4> </j:if> <jsl:applyTemplates select="*"/> </div> </jsl:template> <jsl:template match="source" trim="false"> <div id="source"> <pre><x:expr select="."/></pre> </div> </jsl:template> <jsl:template match="footer" trim="false"> <tr> <td> <jsl:applyTemplates select="*"/> </td> </tr> </jsl:template> <jsl:template match="table" trim="false"> <j:set var="rowcount" value="0"/> <table cellpadding="3" cellspacing="2" border="1" width="100%"> <jsl:applyTemplates select="*"/> </table> </jsl:template> <jsl:template match="tr" trim="false"> <j:choose> <j:when test="${rowMode == 'a'}"> <j:set var="rowMode" value="b"/> </j:when> <j:otherwise> <j:set var="rowMode" value="a"/> </j:otherwise> </j:choose> <!-- copy attributes FIXME: Shouldn't this only be colspan|rowspan? --> <x:element name="tr"><j:whitespace trim="true"> <x:attribute name="class">${rowMode}</x:attribute> <x:forEach var="attr" select="@*"> <x:attribute name="${attr.name}">${attr.value}</x:attribute> </x:forEach> <jsl:applyTemplates select="*"/> </j:whitespace></x:element> </jsl:template> <!--************************--> <!-- glossary documentation --> <!--************************--> <jsl:template match="glossary" trim="false"> <jsl:applyTemplates select="glossary-entries/glossary-entry" /> </jsl:template> <jsl:template match="glossary-entry" trim="false"> <strong><x:expr select="name" /></strong> <br/> <x:expr select="definition" /> <p/> </jsl:template> <!--************************--> <!-- goals documentation --> <!--************************--> <jsl:template match="goals" trim="false"> <!-- reset row alternation --> <j:set var="rowMode" value="" /> <div class="h3"> <h3><a name="Goals">Goals</a></h3> <table> <tr width='100%'><th>Goal</th><th>Description</th></tr> <jsl:applyTemplates select="goal"/> </table> </div> </jsl:template> <!-- a goal --> <!-- FIXME: this is copied from tr - there must be a way of calling templates in jsl? --> <jsl:template match="goal" trim="false"> <j:choose> <j:when test="${rowMode == 'a'}"> <j:set var="rowMode" value="b"/> </j:when> <j:otherwise> <j:set var="rowMode" value="a"/> </j:otherwise> </j:choose> <x:element name="tr"><j:whitespace trim="true"> <x:attribute name="class">${rowMode}</x:attribute> <j:set var="_goalName"><x:expr select="./name" /></j:set> <td width='20%'><a name="${_goalName}">${_goalName}</a></td> <td width='80%'><jsl:applyTemplates select="description" /></td> </j:whitespace></x:element> </jsl:template> <jsl:template match="description"> <jsl:copy trim="false"> <jsl:applyTemplates trim="false"/> </jsl:copy> </jsl:template> <!--************************--> <!-- changelog documentation--> <!--************************--> <jsl:template match="changelog" trim="false"> <j:set var="rowMode" value="" /> <table width="100%"> <tr> <th>Date</th><th>Author</th><th>Files/Message</th> </tr> <jsl:applyTemplates select="changelog-entry" /> </table> </jsl:template> <!-- transform a changelog entry --> <!-- FIXME: tr code copied from above --> <jsl:template match="changelog-entry" trim="false"> <j:choose> <j:when test="${rowMode == 'a'}"> <j:set var="rowMode" value="b"/> </j:when> <j:otherwise> <j:set var="rowMode" value="a"/> </j:otherwise> </j:choose> <x:element name="tr"><j:whitespace trim="true"> <x:attribute name="class">${rowMode}</x:attribute> <td><x:expr select="date" /> <x:expr select="time" /></td> <td><x:expr select="author"/></td> <td><jsl:applyTemplates select="*" /> <pre><x:expr select="msg"/></pre> </td> </j:whitespace></x:element> </jsl:template> <jsl:template match="file"> <j:set var="url">${pom.repository.url}<x:expr select="name"/></j:set> <j:set var="revUrl">${url}?<x:expr select="revision"/>&content-type=text/vnd.viewcvs-markup</j:set> <a href="${url}"><x:expr select="name"/></a> - <a href="${revUrl}">v<x:expr select="revision"/></a> <br/> </jsl:template> <!-- remove the space at the end of parsed "a" anchors --> <jsl:template match="a" trim="false"> <jsl:copy trim="true"> <jsl:applyTemplates trim="true"/> </jsl:copy> </jsl:template> <!-- copy any other elements through --> <jsl:template match="*" trim="false"> <jsl:copy trim="false"> <jsl:applyTemplates trim="false"/> </jsl:copy> </jsl:template> <!-- element values don't pass through as text --> <jsl:template match="@*"/> </jsl:stylesheet> 1.1 avalon-logkit/xdocs/features.xml Index: features.xml =================================================================== <!-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <document> <properties> <author email="dev@avalon.apache.org">Avalon Development Team</author> <title>Logkit - Features</title> </properties> <body> <section name="Features"> <p> <strong>This document is under construction!</strong> </p> <p>The LogKit provides the following features:</p> <ul> <li>Decouples LogEvent generation from LogEvent handling.</li> <li>Is simple to use and simple to configure.</li> <li>Designed with security in mind.</li> <li> Allow users fine control of logging based on priority and/or category. </li> <li> Has hierarchical logging namespace to enable inheritance of LogTargets and Priorities. </li> <li>Lightweight.</li> <li>Designed to be integrated into existing products.</li> <li>Performance oriented.</li> <li> Enables users to plug in filters to filter out or modify LogEvents before they are written out. </li> <li> Allow users to specify the serialization format of LogEvents via Formatters. </li> <li> Comes with a number of existing LogTargets to ease integration. </li> <li> The LogKit has existed for a number years and been used in a number of different environments which demonstrates it's reliability and stability. </li> </ul> </section> </body> </document> 1.1 avalon-logkit/xdocs/index.xml Index: index.xml =================================================================== <!-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <document> <properties> <author email="dev@avalon.apache.org">Avalon Development Team</author> <title>Logkit - Introduction</title> </properties> <body> <section name="Introduction"> <p> LogKit is a logging toolkit designed for secure performance oriented logging in applications. To get started using LogKit, it is recomended that you read the <a href="whitepaper.html">whitepaper</a> and browse the <a href="http://avalon.apache.org/logkit/api/index.html">API docs</a>. </p> </section> </body> </document> 1.1 avalon-logkit/xdocs/navigation.xml Index: navigation.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <project> <title>Avalon LogKit</title> <body> <links> <item name="Apache" href="http://apache.org/"/> <item name="Avalon" href="http://avalon.apache.org/"/> </links> <menu name="About Avalon LogKit"> <item name="Overview" href="index.html"/> <item name="Features" href="features.html"/> <item name="Whitepaper" href="whitepaper.html"/> <item name="Javadoc" href="/apidocs/index.html"/> <item name="Download" href="http://avalon.apache.org/download.cgi"/> </menu> <menu name="Related Projects"> <item name="Avalon Framework" href="http://avalon.apache.org/product/framework/"/> <item name="Avalon Logging" href="http://avalon.apache.org/logging"/> <item name="Avalon Merlin" href="http://avalon.apache.org/merlin"/> </menu> </body> </project> 1.1 avalon-logkit/xdocs/whitepaper.xml Index: whitepaper.xml =================================================================== <!-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <document> <properties> <author email="dev@avalon.apache.org">Avalon Development Team</author> <title>Logkit - Whitepaper</title> </properties> <body> <section name="Abstract"> <p> Logging is an integral component to any software development project. During the development stages it offers a valuable source of debugging information for the developer. During deployment it can provide valuable operational data that allows administrators to diagnose problems as they arise. This whitepaper describes the design and implementation of LogKit. </p> </section> <section name="Introduction"> <p> LogKit, began life as a facade for a more complex logging toolkit. During development it was found that existing toolkits were complex and difficult to use. A malformed logger configuration file could cause the whole system to fail or the logging information to go into the void. </p> <p> Over time it was discovered that the facade, while simple to use, inherited many of the faults of the underlying logging toolkit. The logging was slow and was impossible to dynamically reconfigure. </p> <p> At this time the whole system was overhauled. Existing logging toolkits were surveyed and user feedback was gathered from both developers and administrators. The new toolkit focused on speed, reliability and dynamic reconfiguration. It then added, at that time unique features, for filtering log events, multiple listeners (aka LogTargets) per category and delayed serialization of events. </p> </section> <section name="Structure and Elements"> <p> The most basic components of LogKit are the Logger, the LogEvent and the LogTarget. The Logger represents the client interface to the logging system. The developer interacts with Logger to generate LogEvents. The LogEvents are routed to a LogTarget. The LogTarget decides what to do with the LogEvent, usually it is recorded to a file, a database or transmitted over the network. </p> </section> <section name="Priorities"> <p> One of the advantages of a logging toolkit is fine grain control over which statements get printed. At some times during development you may wish to enable all logging statements and at other times they may wish to disable debug messages. It was from this need that the notion of of Priorities were born. A Priority describes the urgency of a LogEvent. Below is a list of priorities that are usable within the LogKit system (extracted from the constants of class org.apache.log.Priority). </p> <ul> <li> <strong>DEBUG:</strong> <br/> Developer oriented messages, usually used during development of the product. </li> <li> <strong>INFO:</strong> <br/> Useful information messages such as state changes, client connection, user login etc. </li> <li> <strong>WARN:</strong> <br/> A problem or conflict has occurred but it may be recoverable, then again it could be the start of the system failing. </li> <li> <strong>ERROR:</strong> <br/> A problem has occurred but it is not fatal. The system will still function. </li> <li> <strong>FATAL_ERROR:</strong> <br/> Something caused whole system to fail. This indicates that an administrator should restart the system and try to fix the problem that caused the failure. </li> </ul> <p> The range of priorities is limited by design as past experience has indicated more levels do not offer any significant advantage to the user. </p> <p> Each logger instance is associated with a Priority. This allows you to limit each logger so that it only displays messages greater than a certain priority. So if a DEBUG message occurred and the logger's priority was WARN, the LogEvent would be suppressed. </p> <p> A user can log at a certain priority by calling a method with matching name and the message as a string. For instance to log at debug level you would call logger.debug("My Message"). Similar methods exist for info(), warn() and error(). There is also a set of similarly named methods that take both a message string and an exception. </p> <p> Where performance is critical it is often useful to check if a priority is enabled before constructing the message. In many cases the construction of the message is an expensive string operation and conversion operation. In this case it is useful to know before you create the message whether it will be logged. The pattern of the method to check if a priority is enabled is "is<Priority>Enabled()". An example use case is displayed below. </p> <source> if( logger.isDebugEnabled() ) { //Construct a message (expensive operation) final String message = "Var1 value: " + var1 + "\tVar2 value: " + var2 + "\tVar3 value: " + var3 + "."; logger.debug( message ); } </source> </section> <section name="Categories"> <p> In a complex system it is often not enough to suppress logging based on priority. For instance you may wish to log the network subsystem with DEBUG priority while the simulator subsystem with WARN priority. To accomplish this LogKit uses a concept termed Categories. Categories, often called Channels, Subjects or Facilities, are a subdivision of the logging namespace. </p> <p> Each category is a name, made up of name components separated by a ".". So a category named "network.interceptor.connected" is made up of three name components "network", "interceptor" and "connected", ordered from left to right. Every logger is associated with a category at creation. </p> <p> LogKit takes it one step further and assumes that the namespace is hierarchical. The left-most name component is the most generic category while the right-most name component is the most specific. So "network.interceptor.connected" is a child category of "network.interceptor", which is in turn a child category of "network". There is also a root category "" that is hidden inside the org.apache.log.Hierarchy class. </p> <p> The main reason for structuring logging namespace in a hierarchical manner is to allow inheritance. A logger will inherit it's parent priority if it has not been explicitly set. This allows you to set the "network" logger to have INFO priority and unless the "network.interceptor" has had it's priority set it will inherit the INFO priority. </p> <p> Unlike other logging toolkits, there is no performance penalty for having deep hierarchies. Each logger caches a Priority to check against. When a logger has it's logger set or unset, it updates the cached version of it's child loggers. </p> </section> <section name="Log Targets"> <p> In LogKit, LogTargets are the destination of LogEvents. Decoupling LogEvent generation from handling allows developers to change destinations of LogEvents dynamically or via configuration files. Possible destinations include writing to a database, a file, an IRC channel, a syslog server, an instant messaging client etc. </p> <p> Like Priorities, it is often useful to allow LogTargets to be inherited between loggers. Like Priority inheritance, LogTarget inheritance does not suffer any runtime performance penalty. </p> <section name="Filters"> <p> Filters are a special kind of LogTarget. Instead of writing to an output destination they are used to filter out LogEvents or modify the LogEvents details and pass it on to another LogTarget. </p> <p> This can be a useful feature when you assign multiple LogTargets to a logger. For instance you may add two LogTargets to a logger, one which writes LogEvents to a database and one which writes a message to the administrators pager. However you may want to record all messages to the database but only transmit FATAL_ERROR messages to pager. In this case you would use a PriorityFilter to filter out non-FATAL_ERROR messages for pager log target. </p> </section> <section name="AsyncLogTarget"> <p> AsyncLogTarget is another kind of special LogTarget. It takes a log event and copies it into a queue so that another thread can actually write the LogEvent to another LogTarget. This is useful if logging to a particular LogTarget is a slow operation (such as a MailLogTarget). </p> <p> Below is a snippet of code that creates an AsyncLogTarget to write messages in another thread. </p> <source> LogTarget mySlowTarget = ...; AsyncLogTarget asyncTarget = new AsyncLogTarget( mySlowTarget ); Thread thread = new Thread( asyncTarget ); thread.setPriority( Thread.MIN_PRIORITY ); thread.start(); logger.setLogTargets( new LogTarget[] { asyncTarget } ); </source> </section> </section> <section name="Formatters"> <p> LogTargets that write to a serial or unstructured store (ie filesystem or network based LogTargets) need some method to serialize the LogEvent before writing to the store. The most common way to serialize the LogEvent is to use a Formatter. </p> <p> The Formatter interface takes a LogEvent and returns a String object. The most commonly use LogEvent is the PatternFormatter. The pattern formatter takes a format specifier that has a similar format to c's printf function. </p> <p> The format specifier consists of a string containing raw text combined with pattern elements. Each pattern element has the generalized form "%[+|-]#.#{field:subformat}". The +|- indicates whether the pattern element should be left or right justified (defaults to left justified if unspecified). The #.# indicates the minimum and maximum size of output, if unspecified the output is neither padded nor truncated. 'field' indicates the field to be written and must be one of "category", "context", "message", "time", "rtime" (time relative to start of application), "throwable" or "priority". This parameter must be supplied and correlates to fields of LogEvent. 'subformat' is currently unused except in the case of "context" field. This is further discussed below. </p> <p> Following is a number of examples for PatternFormatter's format specifier and actual output. </p> <source> format: "%7.7{priority} %5.5{rtime} [%8.8{category}]: %{message}\n%{throwable}" output: DEBUG 123 [network.]: This is a debug message format: "%7.7{priority} %5.5{rtime} [%{category}]: %{message}\n" output: DEBUG 123 [network.interceptor.connected]: This is a debug message output: DEBUG 123 [network]: This is another debug message format: "%7.7{priority} %5.5{rtime} [%10.{category}]: %{message}\n" output: DEBUG 123 [network.interceptor.connected]: This is a debug message output: DEBUG 123 [network ]: This is another debug message </source> <p> There is also ExtendedPatternFormatter that allows two extra fields, namely "method" and "thread". The "method" field attempts to determine the method that called the Logger method to generate the LogEvent. The "thread" field displays the name of the current thread. </p> </section> <section name="Context"> <p> In many systems you need to include extra information depending in logs that depends on information not included in the LogEvent. For instance the Formatters section described an ExtendedPatternFormatter that included information such as calling method and calling thread. Other contextual information that you may need to include in log files include user executing log statement, the network interface that the client component is listening to (ie 127.0.0.1 vs 192.168.1.1), hostname (especially important on multihomed boxs) or source of LogEvent (useful when writing a centralized log server). </p> <p> There are a number of strategies to deal with application specific contextual information. Some logging toolkits encourage extending the Logger, LogEvent and LogTargets while others encourage using application specific LogTargets. The way that LogKit solves this problem is by using a generic ContexMap object. </p> <p> The ContextMap allows the user to store arbitrary objects using a string key. These objects can then be extracted by the LogTargets and used as appropriate. If you were using the PatternFormatter you could extract a value from ContextMap by specify the "context" field with it's subformat set to the appropriate key. Some examples are illustrated below. </p> <source> format: "%7.7{priority} [%{context:hostname}]: %{message}\n" output: DEBUG [helm.realityforge.org]: This is a debug message format: "%7.7{priority} [%{context:interface}]: %{message}\n" output: DEBUG [127.0.0.1]: This is logging about loopback interface output: DEBUG [192.168.1.1]: This is logging about internal network interface output: DEBUG [203.121.1.2]: This is logging about external network interface format: "%7.7{priority} [%{context:user}]: %{message}\n" output: DEBUG [Barney Rubble]: This is a debug message </source> <p> <em>Warning:</em> Older versions of LogKit also incorporated a ContextStack that offered hierarchical management of context. It was discovered that this design encouraged bad practices and thus use of this feature has been deprecated in favour of using ContextMap. The ContextStack is still accessible if users do not specify a subformat or specify the subformat "stack". However it is strongly advised that users do not use this feature as it will be removed in a future iteration. </p> <p> When using a ContextMap you create the object and populate it using the set(key,value) method. After populating the ContextMap you call the method makeReadOnly(). This makes it impossible for hostile code to modify context in which logging occurs. </p> <p> Then you need to associate the ContextMap with a thread by using ContextMap.bind( myContextMap ). The ContextMap is bound to a thread using java.lang.InheritableThreadLocal and thus maps are inherited between threads as specified by InheritableThreadLocal. </p> <p>Below is an example of how a user can create and bind a ContextMap.</p> <source> final ContextMap context = new ContextMap(); context.set( "user", "Fred Flinstone" ); context.set( "interface", myInterface ); context.set( "hostname", "helm.realityforge.org" ); context.set( "jvmid", myJvmId ); context.makeReadOnly(); //bind new ContextMap to current thread and subthreads ContextMap.bind( context ); </source> </section> <section name="Examples" > <p> One of the best ways to learn how to use a toolkit is to see an example in action. With that heres some example uses of LogKit. The first example is in a simple application while the next example is in a servlet. The servlet example demonstrates the usage of filters. </p> <source> Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor("myCategory"); logger.setPriority( Priority.DEBUG ); logger.debug( "This is a debug message" ); </source> <source> //Create a Log filter that writes to servlet Containers log //If priority greater than ERROR PriorityFilter filter = new PriorityFilter(Priority.ERROR); filter.addTarget( new ServletOutputLogTarget(context) ); String logName = getInitParameter("log-name"); if( null == logName ) logName = "myservlet.log"; final String path = context.getRealPath("/") + "/WEB-INF/logs/" + logName ; //Create a logger to write to a file as specified //with servlet init parameters final String pattern = "%7.7{priority} %5.5{time} [%8.8{category}] " + "(%{context}): %{message}\\n%{throwable}"; final PatternFormatter formatter = new PatternFormatter( pattern ); final File file = new File( path ); //open file target in append mode FileTarget target = new FileTarget( file, true, formatter ); //Create logger myLogger = Hierarchy.getDefaultHierarchy().getLoggerFor("myServlet"); //Set log targets of logger myLogger.setLogTargets( new LogTarget[] { target, filter } ); String logLevel = getInitParameter("log-priority"); if( null == logLevel ) logLevel = "DEBUG"; //Set log targets parameter based on init parameters Priority priority = Priority.getPriorityForName( logLevel ); myLogger.setPriority( priority ); </source> </section> <section name="Conclusion"> <p> LogKit is a friendly, easy to use logging toolkit. It is high performing and easily integrated into existing products. By design it does not specify any configuration format but instead encourages users to integrate it into their existing products. It also is designed to run in a secure environment by limiting client access to hierarchies. </p> </section> </body> </document> 1.1 avalon-logkit/xdocs/style/maven.css Index: maven.css =================================================================== body { background: #fff; color: #000; } .app h3 { color: #fff; background-color: #036; } .app h4 { color: #fff; background-color: #888; } .a td { background: #ddd; color: #000; } .b td { background: #efefef; color: #000; } .app th { background-color: #bbb; color: #fff; } div#banner { border-top: 1px solid #369; border-bottom: 1px solid #003; } #banner, #banner td { background: #fff; color: #000; } #leftcol { background: #eee; color: #000; border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; border-top: 1px solid #fff; } #navcolumn { background: #eee; color: #000; border-right: none; border-bottom: none; border-top: none; } #breadcrumbs { background-color: #ddd; color: #000; border-top: 1px solid #fff; border-bottom: 1px solid #aaa; } #source { background-color: #fff; color: #000; border-right: 1px solid #888; border-left: 1px solid #888; border-top: 1px solid #888; border-bottom: 1px solid #888; margin-right: 7px; margin-left: 7px; margin-top: 1em; } #source pre { margin-right: 7px; margin-left: 7px; } a[name]:hover, #leftcol a[name]:hover { color: inherit !important; } a:link, #breadcrumbs a:visited, #navcolumn a:visited, .app a:visited, .tasknav a:visited { color: blue; } a:active, a:hover, #leftcol a:active, #leftcol a:hover { color: #f30 !important; } a:link.selfref, a:visited.selfref { color: #555 !important; } h3, h4 { margin-top: 1em; margin-bottom: 0; } 1.1 avalon-logkit/xdocs/style/stylesheet.css Index: stylesheet.css =================================================================== /* Javadoc style sheet */ /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Table colors */ .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } .FrameHeadingFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } .FrameItemFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } /* Example of smaller, sans-serif font in frames */ /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 1.1 avalon-logkit/xdocs/style/tigris.css Index: tigris.css =================================================================== /* contains rules unsuitable for Netscape 4.x; simpler rules are in ns4_only.css. see <http://style.tigris.org/> */ /* colors, backgrounds, borders, link indication */ body { background: #fff; color: #000; } .app h3, .app h4, .app th, .tabs td, .tabs th, .functnbar { background-image: url(../images/nw_min.gif); background-repeat: no-repeat; } #navcolumn div div, body.docs #toc li li { background-image: url(../images/strich.gif); background-repeat: no-repeat; background-position: .5em .5em; } #navcolumn div div.heading { background-image: none; } .app h3, .app h4 { color: #fff; } .app h3 { background-color: #036; } .app h4 { background-color: #888; } .a td { background: #ddd; } .b td { background: #efefef; } table, th, td { border: none } .mtb { border-top: solid 1px #ddd; } div.colbar { background: #bbb; } div#banner { border-top: 1px solid #369; border-bottom: 1px solid #003; } div#helptext th { border-bottom: 1px solid #996; border-right: 1px solid #996; } div#helptext td { border-bottom: 1px solid #cc9; border-right: 1px solid #cc9; } .tabs { border-bottom: .75em #888 solid; } .tabs th, .tabs td { border-right: 1px solid #333; } .tabs td { border-bottom: 1px solid #ddd; } #navcolumn { background: #eee; border-right: 1px solid #aaa; border-bottom: 1px solid #aaa; } #breadcrumbs { border-bottom: 1px solid #aaa; background-color: #ddd; } #navcolumn, #breadcrumbs { border-top: 1px solid #fff; } #rightcol div.www, #rightcol div.help { border: 1px solid #ddd; } div#navcolumn div.focus { border-top: 1px solid #aaa; border-left: 1px solid #aaa; background-color: #fff; } body.docs div.docs { background: #fff; border-left: 1px solid #ddd; border-top: 1px solid #ddd; } body.docs { background: #eee url(../images/help_logo.gif) top right no-repeat !important; } .docs h3, .docs h4 { border-top: solid 1px #000; } #alerterrormessage { background: url(../images/icon_alert.gif) top left no-repeat !important; } .functnbar { background-color: #aaa; } .functnbar2, .functnbar3 { background: #aaa url(../images/sw_min.gif) no-repeat bottom left; } .functnbar3 { background-color: #ddd; } .functnbar, .functnbar2, .functnbar3 { color: #000; } .functnbar a, .functnbar2 a, .functnbar3 a { color: #000; text-decoration: underline; } #topmodule { background: #ddd; border-top: 1px solid #fff; border-bottom: 1px solid #aaa; border-right: 1px solid #aaa; } #topmodule #issueid { border-right: 1px solid #aaa; } a:link, #navcolumn a:visited, .app a:visited, .tasknav a:visited { color: blue; } a:active, a:hover, #leftcol a:active, #leftcol a:hover { color: #f30 !important; } #login a:link, #login a:visited { color: white; text-decoration: underline; } #banner a:active, #banner a:hover { color: #f90 !important; } #leftcol a, #breadcrumbs a { text-decoration: none; } a:link.selfref, a:visited.selfref { color: #555 !important; text-decoration: none; } h2 .lastchild { color: #777 } .tabs td, .tabs th { background-color: #ddd; } .app th { background-color: #bbb; } .tabs th { background-color: #888; color: #fff; } .axial th { background-color: #ddd; color: black } .tabs td { background-color: #ddd; } .alert { color: #c00; } .confirm { color: green; } .info { color: blue; } .selection { background: #ffc; } #login { color: #fff; } #helptext th { background: #cc9; } #helptext td { background: #ffc; } .tabs a { text-decoration: none; } #navcolumn div strong { color: #000; } #banner, #banner td { background: #036; color: #fff; } body #banner #login a { color: #fff; } /* font and text properties, exclusive of link indication, alignment, text-indent */ body, th, td, input, select, textarea, h2 small { font-family: Verdana, Helvetica, Arial, sans-serif; } code, pre { font-family: 'Andale Mono', Courier, monospace; } html body, body th, body td, textarea, h2 small, .app h3, .app h4, #rightcol h3, #bodycol pre, #bodycol code { font-size: x-small; voice-family: "\"}\""; voice-family: inherit; font-size: small } html>body, html>body th, html>body td, html>body input, html>body select, html>body textarea, html>body h2 small, html>body .app h3, html>body .app h4, html>body #rightcol h3, html>body #bodycol pre, html>body #bodycol code { font-size: small } small, div#footer td, div#login, div#helptext th, div#helptext td, div.tabs th, div.tabs td, input, select, .paginate, .functnbar, .functnbar2, .functnbar3, #breadcrumbs td, .courtesylinks, #rightcol div.help, .colbar, .tasknav, body.docs div#toc { font-size: xx-small; voice-family: "\"}\""; voice-family: inherit; font-size: x-small } html>body small, html>body div#footer td, html>body div#login, html>body div#helptext td, html>body div#helptext th, html>body div.tabs th, html>body div.tabs td, html>body input, html>body select, html>body .paginate, html>body .functnbar, html>body .functnbar2, html>body .functnbar3, html>body #breadcrumbs td, html>body .courtesylinks, html>body #rightcol div.help, html>body .colbar, html>body .tasknav, html>body.docs #toc { font-size: x-small } #bodycol h2 { font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; font-size: 1.5em; font-weight: normal; } h2 small { font-weight: bold; letter-spacing: .06em; } dt { font-weight: bold } #login .username { font-weight: bold; } h4 { font-size: 1em; } #breadcrumbs td { font-weight: bold; } .selection { font-weight: bold } /* box properties (exclusive of borders), positioning, alignments, list types, text-indent */ #bodycol h2 { margin-top: .3em; margin-bottom: .5em; } p, ul, ol, dl { margin-top: .67em; margin-bottom: .67em; } h3, h4 { margin-bottom: 0; } form { margin-top: 0; margin-bottom: 0; } #bodycol { padding-left: 12px; padding-right: 12px; width: 100%; voice-family: "\"}\""; voice-family: inherit; width: auto; } html>body #bodycol { width: auto; } .docs { line-height: 1.4; } .app h3, .app h4 { padding: 5px; margin-right: 2px; margin-left: 2px; } .h3 p, .h4 p, .h3 dt, .h4 dt { margin-right: 7px; margin-left: 7px; } .tasknav { margin-bottom: 1.33em } div.colbar { padding: 4px; margin: 2px 2px 0; } .tabs { margin-top: .67em; margin-right: 2px; margin-left: 2px; } #leftcol { padding-bottom: .5em; } #breadcrumbs td { vertical-align: middle; padding: 2px 8px; } #rightcol div.www, #rightcol div.help { padding: 0 .5em } #navcolumn { margin: -8px -8px 0 -8px; padding: 4px; } #navcolumn div { padding-left: 5px } div#navcolumn div div { margin-top: .3em; margin-bottom: .3em; } div#navcolumn div.focus { margin-top: -.1em; padding: .2em 4px; } body.docs #toc { position: absolute; top: 15px; left: 0px; width: 120px; padding: 0 20px 0 0 } body.docs #toc ul, #toc ol { margin-left: 0; padding-left: 0; } body.docs #toc li { margin-top: 7px; padding-left: 10px; list-style-type: none; } body.docs div.docs { margin: 61px 0 0 150px; padding: 1em 2em 1em 1em !important; } .docs p+p { text-indent: 5%; margin-top: -.67em } .docs h3, .docs h4 { margin-bottom: .1em; padding-top: .3em; } #alerterrormessage { padding-left: 100px; } .functnbar, .functnbar2, .functnbar3 { padding: 5px; margin: .67em 2px; } #topmodule td { vertical-align: middle; padding: 2px 8px } body { padding: 1em; } body.composite, body.docs { margin: 0; padding: 0; } th, td { text-align: left; vertical-align: top } .right { text-align: right !important; } .center { text-align: center !important; } .tabs td, .tabs th { padding-left: 7px; padding-right: 7px; } .axial th { text-align: right; } .app .axial td th { text-align: left; } body td .stb { margin-top: 1em; text-indent: 0; } body td .mtb { margin-top: 2em; text-indent: 0; } dd { margin-bottom: .67em; } #footer { margin: 4px } #helptext { margin-top: 1em } #helptext td div { margin: .5em } .courtesylinks { margin-top: 1em; padding-top: 1em } #navcolumn div { margin-bottom: .5em; } #navcolumn div div { margin-top: .3em } #navcolumn div div { padding-left: 1em; } #banner, #banner td { vertical-align: middle; } body.docs, body.nonav { margin: 1em }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]