You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by js...@apache.org on 2001/07/24 17:29:49 UTC

cvs commit: jakarta-taglibs/log/xml log.xml

jstrachan    01/07/24 08:29:49

  Modified:    log      build.xml
               log/examples/conf log4j.properties
               log/examples/web index.html test1.jsp test2.jsp test3.jsp
                        test4.jsp test5.jsp test6.jsp
               log/xml  log.xml
  Removed:     log/doc/web changes.xml
               log/lib  log4j.jar
  Log:
  Initial version of log taglib working with the new build system
  
  Revision  Changes    Path
  1.5       +18 -9     jakarta-taglibs/log/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/build.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.xml	2001/07/10 03:44:48	1.4
  +++ build.xml	2001/07/24 15:29:49	1.5
  @@ -6,26 +6,35 @@
   
   <project name="log" default="main">
   
  -  <property file="../build.properties"/>
  -  <property name="classpath" value="${servlet.jar}:lib/log4j.jar" />
  -  <property name="library.pre" value="library.pre"/>
  -  <property name="gen-docs.present" value="true"/>
  +  <property file="../build.properties"/>
  +  <property name="classpath" value="${servlet.jar}:${log4j-core.jar}" />
   
  +  <property name="checkRequirements.pre" value="checkRequirements.pre"/>
  +  <property name="examples.pre" value="examples.pre"/>
  +
  +  <target name="checkRequirements.pre">
  +    <antcall target="checkRequiredFile">
  +       <param name="file" value="${log4j-core.jar}"/>
  +       <param name="fail.message" value="a jar file containing the log4j classes is required to compile the log taglib. please define the property log4j-core.jar in your build.properties file and ensure that the file exists"/>
  +    </antcall>
  +  </target>
  +
  +
     <!-- =================================================================== -->
  -  <!-- copy the dom4j and log4j jars into the examples lib dir             -->
  +  <!-- copy the required jars into the examples lib dir                    -->
     <!-- =================================================================== -->
  -  <target name="library.pre" depends="gen-docs">
  -    <copy todir="${build.examples}/WEB-INF/lib">
  -      <fileset dir="lib" includes="*.jar"/>
  -    </copy>
   
  +  <target name="examples.pre">
       <!-- copy a default log4j config file -->
       <copy todir="${build.examples}/WEB-INF/classes">
         <fileset dir="${examples.src}/conf" includes="*.properties"/>
       </copy>
  +    <!-- copy the jars required -->
  +    <copy todir="${build.examples}/WEB-INF/lib" file="${log4j-core.jar}"/>
     </target>
   
     &common;
  +
   
   </project>
   
  
  
  
  1.2       +2 -1      jakarta-taglibs/log/examples/conf/log4j.properties
  
  Index: log4j.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/conf/log4j.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- log4j.properties	2001/06/26 18:50:09	1.1
  +++ log4j.properties	2001/07/24 15:29:49	1.2
  @@ -1,5 +1,6 @@
   # Sample properties to initialise log4j
  -log4j.rootCategory=debug, stdout, R
  +#log4j.rootCategory=debug, stdout, R
  +log4j.rootCategory=debug, stdout
   
   log4j.appender.stdout=org.apache.log4j.ConsoleAppender
   log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  
  
  
  1.3       +6 -6      jakarta-taglibs/log/examples/web/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/index.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.html	2001/06/26 18:50:10	1.2
  +++ index.html	2001/07/24 15:29:49	1.3
  @@ -4,12 +4,12 @@
   </HEAD>
   <BODY>
   <OL>
  -<LI><A HREF="test1.jsp">Test #1</A> - tests &lt;log:debug /&gt;
  -<LI><A HREF="test2.jsp">Test #2</A> - tests &lt;log:info /&gt;
  -<LI><A HREF="test3.jsp">Test #3</A> - tests &lt;log:warn /&gt;
  -<LI><A HREF="test4.jsp">Test #4</A> - tests &lt;log:error /&gt;
  -<LI><A HREF="test5.jsp">Test #5</A> - tests &lt;log:fatal /&gt;
  -<LI><A HREF="test6.jsp">Test #6</A> - tests &lt;log:dump /&gt;
  +<LI><A HREF="test1.jsp">Test #1</A> - tests &lt;log:debug /&gt; <a href="test1.html">Source</a>
  +<LI><A HREF="test2.jsp">Test #2</A> - tests &lt;log:info /&gt; <a href="test2.html">Source</a>
  +<LI><A HREF="test3.jsp">Test #3</A> - tests &lt;log:warn /&gt; <a href="test3.html">Source</a>
  +<LI><A HREF="test4.jsp">Test #4</A> - tests &lt;log:error /&gt; <a href="test4.html">Source</a>
  +<LI><A HREF="test5.jsp">Test #5</A> - tests &lt;log:fatal /&gt; <a href="test5.html">Source</a>
  +<LI><A HREF="test6.jsp">Test #6</A> - tests &lt;log:dump /&gt; <a href="test6.html">Source</a>
   </OL>
   </BODY>
   </HTML>
  
  
  
  1.2       +5 -6      jakarta-taglibs/log/examples/web/test1.jsp
  
  Index: test1.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/test1.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test1.jsp	2001/05/10 19:29:56	1.1
  +++ test1.jsp	2001/07/24 15:29:49	1.2
  @@ -1,16 +1,15 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  +<html>
   <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
  -<HTML>
   <HEAD>
  -<TITLE>Test #1</TITLE>
  +<TITLE>Test debug</TITLE>
   </HEAD>
   <BODY>
  +<h1>Test debug</h1>
   <log:debug>This is body content.</log:debug>
   <log:debug message="This is attribute content." />
   <log:debug category="test1">This is body content in category test1.</log:debug>
   You should see output in the debug logs now.
  -
  -<H2>File source</H2>
  -<PRE><%@include file="test1.txt"%></PRE>
   </BODY>
  -</HTML>
  +</html>
   
  
  
  
  1.2       +5 -6      jakarta-taglibs/log/examples/web/test2.jsp
  
  Index: test2.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/test2.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test2.jsp	2001/05/10 19:29:56	1.1
  +++ test2.jsp	2001/07/24 15:29:49	1.2
  @@ -1,16 +1,15 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  +<html>
   <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
  -<HTML>
   <HEAD>
  -<TITLE>Test #2</TITLE>
  +<TITLE>Test info</TITLE>
   </HEAD>
   <BODY>
  +<h1>Test info</h1>
   <log:info>This is body content.</log:info>
   <log:info message="This is attribute content." />
   <log:info category="test2">This is body content in category test2.</log:info>
   You should see output in the info logs now.
  -
  -<H2>File source</H2>
  -<PRE><%@include file="test2.txt"%></PRE>
   </BODY>
  -</HTML>
  +</html>
   
  
  
  
  1.2       +5 -6      jakarta-taglibs/log/examples/web/test3.jsp
  
  Index: test3.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/test3.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test3.jsp	2001/05/10 19:29:56	1.1
  +++ test3.jsp	2001/07/24 15:29:49	1.2
  @@ -1,16 +1,15 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  +<html>
   <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
  -<HTML>
   <HEAD>
  -<TITLE>Test #3</TITLE>
  +<TITLE>Test warn</TITLE>
   </HEAD>
   <BODY>
  +<h1>Test warn</h1>
   <log:warn>This is body content.</log:warn>
   <log:warn message="This is attribute content." />
   <log:warn category="test3">This is body content in category test3.</log:warn>
   You should see output in the warn logs now.
  -
  -<H2>File source</H2>
  -<PRE><%@include file="test3.txt"%></PRE>
   </BODY>
  -</HTML>
  +</html>
   
  
  
  
  1.2       +5 -6      jakarta-taglibs/log/examples/web/test4.jsp
  
  Index: test4.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/test4.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test4.jsp	2001/05/10 19:29:56	1.1
  +++ test4.jsp	2001/07/24 15:29:49	1.2
  @@ -1,16 +1,15 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  +<html>
   <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
  -<HTML>
   <HEAD>
  -<TITLE>Test #4</TITLE>
  +<TITLE>Test error</TITLE>
   </HEAD>
   <BODY>
  +<h1>Test error</h1>
   <log:error>This is body content.</log:error>
   <log:error message="This is attribute content." />
   <log:error category="test4">This is body content in category test4.</log:error>
   You should see output in the error logs now.
  -
  -<H2>File source</H2>
  -<PRE><%@include file="test4.txt"%></PRE>
   </BODY>
  -</HTML>
  +</html>
   
  
  
  
  1.3       +5 -6      jakarta-taglibs/log/examples/web/test5.jsp
  
  Index: test5.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/test5.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- test5.jsp	2001/06/26 18:50:10	1.2
  +++ test5.jsp	2001/07/24 15:29:49	1.3
  @@ -1,16 +1,15 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  +<html>
   <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
  -<HTML>
   <HEAD>
  -<TITLE>Test #5</TITLE>
  +<TITLE>Test fatal</TITLE>
   </HEAD>
   <BODY>
  +<h1>Test fatal</h1>
   <log:fatal>This is body content.</log:fatal>
   <log:fatal message="This is attribute content." />
   <log:fatal category="test5">This is body content in category test4.</log:fatal>
   You should see output in the fatal logs now.
  -
  -<H2>File source</H2>
  -<PRE><%@include file="test5.txt"%></PRE>
   </BODY>
  -</HTML>
  +</html>
   
  
  
  
  1.2       +5 -5      jakarta-taglibs/log/examples/web/test6.jsp
  
  Index: test6.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/examples/web/test6.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test6.jsp	2001/06/26 18:50:11	1.1
  +++ test6.jsp	2001/07/24 15:29:49	1.2
  @@ -1,9 +1,11 @@
  +<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
  +<html>
   <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
  -<HTML>
   <HEAD>
  -<TITLE>Test #5</TITLE>
  +<TITLE>Test dump</TITLE>
   </HEAD>
   <BODY>
  +<h1>Test dump</h1>
   <jsp:useBean id="p1" class="java.lang.String" scope="page" />
   <H4>request</H4>
   <log:dump scope="request" />
  @@ -13,8 +15,6 @@
   <log:dump scope="session" />
   <H4>application</H4>
   <log:dump scope="application" />
  -<H2>File source</H2>
  -<PRE><%@include file="test6.txt"%></PRE>
   </BODY>
  -</HTML>
  +</html>
   
  
  
  
  1.3       +99 -44    jakarta-taglibs/log/xml/log.xml
  
  Index: log.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/log/xml/log.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- log.xml	2001/06/26 18:50:16	1.2
  +++ log.xml	2001/07/24 15:29:49	1.3
  @@ -7,16 +7,21 @@
       <author>James Strachan</author>
     </properties>
   
  -  <taglib>
  -    <tlibversion>1.0</tlibversion>
  -    <jspversion>1.1</jspversion>
  -    <shortname>log</shortname>
  -    <taglib-location>/WEB-INF/log.tld</taglib-location>
  -    <uri>/WEB-INF/log.tld</uri>
  -    <prefix>log</prefix>
  -    <info>Log Tag library</info> 
  -    <overview>
  +<taglib>
   
  +  <tlib-version>1.0</tlib-version>
  +  <!-- Minimum version of JSP spec required -->
  +  <jsp-version>1.1</jsp-version>
  +  <!-- jakarta-taglib name of this tag library -->
  +  <short-name>log</short-name>
  +  <!-- URI of taglib -->
  +  <uri>http://jakarta.apache.org/taglibs/log-1.0</uri>
  +  <!-- The name to use in titles, etc. for the taglib -->
  +  <display-name>Log Tag library</display-name>
  +
  +  <description>
  +
  +
       <p>
       The Log library allows you to embed logging calls in your JSP which can be 
       output to a variety of destinations thanks to the power of the
  @@ -44,20 +49,42 @@
       <a href="http://jakarta.apache.org/log4j/docs/index.html">log4j</a> 
       site or a log4j specific mailing list.
       </p>
  -    </overview> 
  +</description> 
       
  -    <requirements-info>
  +  <!-- The following elements are for JSP 1.2 tag libraries only,
  +       and are not used for generating documentation yet.
  +
  +  <validator>
  +
  +  </validator>
  +  <listener>
  +
  +  </listener>
  +       -->
  +
  +  <!-- The taglib-location is used to fill in the web.xml configuration
  +       information in the HTML doc. -->
  +  <taglib-location>/WEB-INF/log.tld</taglib-location>
  +                   
  +  <!-- The prefix is used to fill in the taglib directive
  +       configuration information in the HTML doc. -->
  +  <prefix>log</prefix>
  +
  +
  +  <requirements-description>
       This custom tag library requires a servlet container
       that supports the JavaServer Pages Specification, version 1.1 or higher
       together with a distribution of
       <a href="http://jakarta.apache.org/log4j/docs/index.html">log4j</a>.
  -    </requirements-info>
  +  </requirements-description>
   
  +  <tagtoc name="Loggin Tags">
  +
       <tag>
         <name>debug</name>
  -      <tagclass>org.apache.taglibs.log.DebugTag</tagclass>
  -      <bodycontents>JSP</bodycontents>
  -      <info>Displays a debug-level message</info>
  +      <tag-class>org.apache.taglibs.log.DebugTag</tag-class>
  +      <body-contents>JSP</body-contents>
  +      <description>Displays a debug-level message</description>
         <script-variable>No</script-variable>
         <attribute>
           <name>category</name>
  @@ -70,7 +97,7 @@
           <required>false</required>
         </attribute>
         <restrictions></restrictions>
  -      <usage>
  +      <example><usage>
             <comment>
             </comment>
             <code><![CDATA[
  @@ -82,14 +109,14 @@
     this is a message
   </log:debug>
   ]]></code>
  -      </usage>
  +      </usage></example>
       </tag>
   
       <tag>
         <name>info</name>
  -      <tagclass>org.apache.taglibs.log.InfoTag</tagclass>
  -      <bodycontents>JSP</bodycontents>
  -      <info>Displays a info-level message</info>
  +      <tag-class>org.apache.taglibs.log.InfoTag</tag-class>
  +      <body-contents>JSP</body-contents>
  +      <description>Displays a info-level message</description>
         <script-variable>No</script-variable>
         <attribute>
           <name>category</name>
  @@ -102,7 +129,7 @@
           <required>false</required>
         </attribute>
         <restrictions></restrictions>
  -      <usage>
  +      <example><usage>
             <comment>
             </comment>
             <code><![CDATA[
  @@ -112,16 +139,16 @@
   
   <log:info category="foo.bar">
     this is a message
  -</log:info>
  +</log:description>
   ]]></code>
  -      </usage>
  +      </usage></example>
       </tag>
   
       <tag>
         <name>warn</name>
  -      <tagclass>org.apache.taglibs.log.WarnTag</tagclass>
  -      <bodycontents>JSP</bodycontents>
  -      <info>Displays a warn-level message</info>
  +      <tag-class>org.apache.taglibs.log.WarnTag</tag-class>
  +      <body-contents>JSP</body-contents>
  +      <description>Displays a warn-level message</description>
         <script-variable>No</script-variable>
         <attribute>
           <name>category</name>
  @@ -134,7 +161,7 @@
           <required>false</required>
         </attribute>
         <restrictions></restrictions>
  -      <usage>
  +      <example><usage>
             <comment>
             </comment>
             <code><![CDATA[
  @@ -146,14 +173,14 @@
     this is a message
   </log:warn>
   ]]></code>
  -      </usage>
  +      </usage></example>
       </tag>
   
       <tag>
         <name>error</name>
  -      <tagclass>org.apache.taglibs.log.ErrorTag</tagclass>
  -      <bodycontents>JSP</bodycontents>
  -      <info>Displays a error-level message</info>
  +      <tag-class>org.apache.taglibs.log.ErrorTag</tag-class>
  +      <body-contents>JSP</body-contents>
  +      <description>Displays a error-level message</description>
         <script-variable>No</script-variable>
         <attribute>
           <name>category</name>
  @@ -166,7 +193,7 @@
           <required>false</required>
         </attribute>
         <restrictions></restrictions>
  -      <usage>
  +      <example><usage>
             <comment>
             </comment>
             <code><![CDATA[
  @@ -178,14 +205,14 @@
     this is a message
   </log:error>
   ]]></code>
  -      </usage>
  +      </usage></example>
       </tag>
   
       <tag>
         <name>fatal</name>
  -      <tagclass>org.apache.taglibs.log.FatalTag</tagclass>
  -      <bodycontents>JSP</bodycontents>
  -      <info>Displays a fatal message, usually as the application is about to terminate</info>
  +      <tag-class>org.apache.taglibs.log.FatalTag</tag-class>
  +      <body-contents>JSP</body-contents>
  +      <description>Displays a fatal message, usually as the application is about to terminate</description>
         <script-variable>No</script-variable>
         <attribute>
           <name>category</name>
  @@ -198,7 +225,7 @@
           <required>false</required>
         </attribute>
         <restrictions></restrictions>
  -      <usage>
  +      <example><usage>
             <comment>
             </comment>
             <code><![CDATA[
  @@ -210,14 +237,14 @@
     oh dear I think I'm about to terminate
   </log:fatal>
   ]]></code>
  -      </usage>
  +      </usage></example>
       </tag>
   
       <tag>
         <name>dump</name>
  -      <tagclass>org.apache.taglibs.log.DumpTag</tagclass>
  -      <bodycontents>empty</bodycontents>
  -      <info>Displays all vars in the specified scope</info>
  +      <tag-class>org.apache.taglibs.log.DumpTag</tag-class>
  +      <body-contents>empty</body-contents>
  +      <description>Displays all vars in the specified scope</description>
         <script-variable>No</script-variable>
         <attribute>
           <name>scope</name>
  @@ -225,7 +252,7 @@
           <required>true</required>
         </attribute>
         <restrictions></restrictions>
  -      <usage>
  +      <example><usage>
             <comment>
             </comment>
             <code><![CDATA[
  @@ -234,8 +261,36 @@
   <log:dump scope="session"/>
   <log:dump scope="application"/>
   ]]></code>
  -      </usage>
  +      </usage></example>
       </tag>
  +  </tagtoc>
  +</taglib>
  +
  +<revision release="Pre Beta" date="07/24/2001">
  +  <description>
  +    Clean up of tag library prior to performing a beta
  +    release, moving toward an official release.
  +  </description>
  +  <section name="New features added">
  +    <item>The log tags now do not initialies log4j themselves. 
  +      You can do this yourself using your own mechanism, via a log4j Servlet or by putting a 
  +      log4j.properties file in WEB-INF/classes. 
  +      I use the latter approach in the example web app as I find it easier. 
  +    </item>
  +    <item>
  +      Optimised the tags so that the body is not evaluated if log4j 
  +      has the logging category or priority disabled. 
  +    </item>
  +    <item>
  +      Added new &lt;log:fatal&gt; tag for support for the FATAL level of log4j logging
  +    </item>
  +  </section>
  +</revision>
  +
  +<revision release="Initial version" date="03/03/2000">
  +  <description>Initial check into CVS from Joe's original code, ported to the Jakarta-Taglibs
  +  directory structure and build process.
  +  </description>
  +</revision>
   
  -  </taglib>
   </document>