You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ps...@apache.org on 2003/04/28 09:38:51 UTC

cvs commit: jakarta-log4j-sandbox build.chainsaw.properties.sample chainsaw-build.xml HOWTOBUILD-CHAINSAW2.txt

psmith      2003/04/28 00:38:51

  Added:       .        build.chainsaw.properties.sample chainsaw-build.xml
                        HOWTOBUILD-CHAINSAW2.txt
  Log:
  Added the chainsaw-build.xml and associated build.chainsaw.properties.sample file, plus a HOWTO document on how to get it all running.
  
  Revision  Changes    Path
  1.1                  jakarta-log4j-sandbox/build.chainsaw.properties.sample
  
  Index: build.chainsaw.properties.sample
  ===================================================================
  #
  #
  ## =====================================================================
  ##
  ## Notes on this file:
  ##
  ## This properties file is used by the chainsaw-build.xml file
  ## to build/run Chainsaw 
  ## 
  ## Please see the accompanying HOWTOBUILD-CHAINSAW2.txt
  #
  # @author Paul Smith <ps...@apache.org>
  ## =====================================================================
  #
  #
  #==============================================================================
  # Library Path Stuff
  #==============================================================================
  
  # describes the relative or full path to the Jakarta ORO Reg Exp jar file
  regexp.oro.jar=../oro/jakarta-oro-2.0.6.jar
  regexp.apache.jar=../oro/jakarta-regexp-1.3-dev.jar
  
  
  # JAXP location
  jaxp.home=../jaxp
  jaxp.jaxp.jar=${jaxp.home}/xerces-1.3.0.jar
  jaxp.parser.jar=${jaxp.home}/crimson.jar
  
  #==============================================================================
  # LOG4J configuration stuff
  #==============================================================================
  # Sets the log4j debug flag, by default it will be on, uncomment this line
  # to suppress Log4j configuration information
  #log4j.debug=false
  
  # if set to true, then an external ant call is made to rebuild the log4j core
  # If this is set, the log4j.core.path MUST be set to the root directory
  # of the jakarta-log4j module (where it's build.xml file is located)
  #
  # @TODO: CURRENTLY NOT IMPLEMENTED, WILL ALWAYS REQUIRE log4j.core.jar property set
  #log4j.core.rebuild=true
  
  # The location of a log4j core jar file that you wish to use
  # for building against chainsaw
  log4j.core.jar=log4j-1.3alpha.jar
  
  
  # Defines the relateive/full directory where the log4j configuration file sits
  # this is effectively added to the classpath when Chainsaw runs
  # so Log4j can locate a configuration file
  log4j.configuration.dir=src/config/
  
  # The name of the configuration file to use to configure the log4j environment
  # ideally including some Receivers in it so Chainsaw can get some events!  
  # Log4j will look in the Classpath for this file, of which the log4j.configuration (see above) 
  # property is added
  log4j.configuration=log4j-sample.xml
  #==============================================================================
  
  
  
  1.1                  jakarta-log4j-sandbox/chainsaw-build.xml
  
  Index: chainsaw-build.xml
  ===================================================================
  <!-- 
   =============================================================================
   An ANT script to build the Chainsaw module.
   
   This script requires access to a few Jar's including:
   
   * Log4j.jar (the core Log4j Libraries
   * JAXP
   * Jakarta Reg Exp
   * Jakarata ORO
   
   
   Please look out of the HOWTOBUILD-CHAINSAW2.txt file where you will see 
   more documention on using this file
   =============================================================================
  -->
  <project name="Chainsaw/Logui" basedir="." default="chainsaw2">
  
    <!-- We load some location specific properties from this file, feel free to modify-->
    <property file="build.chainsaw.properties"/>
  
    <property name="log4j.debug" value="true"/>
    <property name="deprecation" value="on"/>
    <property name="debug" value="on"/>
    
    <!-- The directory where source files are stored. -->
    <property name="java.source.dir" value="src/java"/>
  
    <!-- Destination for compiled files -->
    <property name="javac.dest" value="dist_chainsaw/classes"/>
    
    <property name="log4j-chainsaw.jar" value="log4j-chainsaw2.jar"/>
  
    <property name="jar.dest" value="${basedir}"/>
  
    <!-- Construct compile classpath -->
    <path id="compile.classpath">
      <pathelement location="${jaxp.jaxp.jar}"/>
      <pathelement location="${jaxp.parser.jar}"/>
      <pathelement location="${regexp.oro.jar}"/>
      <pathelement location="${regexp.apache.jar}"/>
      <pathelement location="${log4j.core.jar}"/>
    </path>
  
  <!-- Target to clean up the compiled jar file-->
    <target name="clean" depends="init">
      <delete>
        <fileset dir="${jar.dest}">
          <include name="${log4j-chainsaw.jar}"/>
        </fileset>
      </delete>
      
      <delete dir="${javac.dest}"/>
    </target>
    
  
    <target name="init" depends="">
     <mkdir dir="${javac.dest}"/>
    </target>
    
    <target name="compile" depends="init">
      <javac srcdir="${java.source.dir}"
         destdir="${javac.dest}"
        deprecation="${deprecation}"
        debug="${debug}"
        excludes="**/*.html,**/*.jpg,**/servlet/*.java">
        <classpath refid="compile.classpath"/>
      </javac>
  
    </target>
  
    <target name="check-env-external-libs" depends="init">
      <condition property="log4j.core.jar.present">
         <and>
            <isset property="log4j.core.jar" />
            <available file="${log4j.core.jar}">
            </available>
         </and>
      </condition>
    </target>
    
    <target name="check-env-core-jar" depends="init">
      <condition property="external.libraries.oro.present">
         <and>
            <isset property="regexp.oro.jar" />
            <available file="${regexp.oro.jar}"/>
         </and>
      </condition>
      
      <fail unless="external.libraries.oro.present" message="It appears your are missing the Jakarta ORO package.  Please check the build.chainsaw.properties file."/>
  
      <condition property="external.libraries.regexp.present">
         <and>
            <isset property="regexp.apache.jar" />
            <available file="${regexp.apache.jar}"/>
          </and>
      </condition>
      
      <fail unless="external.libraries.regexp.present" message="It appears your are missing the Jakarta Reg Exp package.  Please check the build.chainsaw.properties file."/>
    </target>
  
  <!-- Determines if the environment, properties are all in order -->
    <target name="check-env" depends="check-env-core-jar,check-env-external-libs">
        <condition property="log4j.either.core.or.rebuild">
           <or>
            <isset property="log4j.core.jar.present" />
            <istrue value="${log4j.core.rebuild}" />
           </or>
         </condition>
      <fail unless="log4j.either.core.or.rebuild" message="Properties Configuration check failed (see build.chainsaw.properties).  Either the log4j.core.rebuild property is not true, or you haven't provided a valid log4j.core.jar location property." />
    </target>
    
  <!-- Builds all the code -->
    <target name="build" depends="check-env, compile">
      <copy todir="${javac.dest}">
       <fileset dir="${java.source.dir}" >
        <patternset>
        <include name="**/*.html"/>
        <include name="**/*.jpg"/>
        <include name="**/*.gif"/>
        </patternset>
       </fileset>
      </copy>
  
      <jar jarfile="${jar.dest}/${log4j-chainsaw.jar}" basedir="${javac.dest}"
           includes="**/chainsaw/*">
      </jar>
    </target>
  
  <!-- Ensure that teh log4j.core.jar file is updated with some
    subtle changes to the core libraries that are required for Chainsaw2.
    
    These changes are currently under review for inclusion in the log4j-core release.
  -->
    <target name="update-with-core-changes" depends="init,compile">
      <jar update="true" jarfile="${log4j.core.jar}" basedir="${javac.dest}"
           includes="**/spi/*,**/xml/*,**/net/*"
           >
      </jar>
    
    </target>
    
  <!-- Launches the Chainsaw app -->  
    <target name="chainsaw2" depends="build, update-with-core-changes">
      <!-- Need to fork to avoid problems -->
      <java classname="org.apache.log4j.chainsaw.LogUI" fork="yes">
     <sysproperty key="log4j.configuration" value="${log4j.configuration}" />
     <sysproperty key="log4j.debug" value="${log4j.debug}" />
       
       <classpath>
        <path refid="compile.classpath"/>
        <pathelement location="${jar.dest}/${log4j-chainsaw.jar}"/>
        <pathelement location="${log4j.configuration.dir}"/>
       </classpath>
      </java>
    </target>
  
  </project>
  
  
  1.1                  jakarta-log4j-sandbox/HOWTOBUILD-CHAINSAW2.txt
  
  Index: HOWTOBUILD-CHAINSAW2.txt
  ===================================================================
  HOWTOBUILD-CHAINSAW2.txt
  =======================
  
  This document outlines the steps required to build and run the Sandbox version 
  Chainsaw (version 2).
  
  Comments/Changes/Bugs for this document and build process: 
    * Paul Smith (psmith@apache.org)
    * Scott Deboy (sdeboy@apache.org)
  
  Assumptions
  ===========
  * Familiar with Ant, and have it installed (http://ant.apache.org/)
  
  Step-by-Step to get Chainsaw2 running
  ======================================
  
  1. Download the jakarta-log4j-sandbox (you've probably already done this if you're reading
     this...)
  
  2. Copy the build.chainsaw.properties.sample file -> build.chainsaw.properties
  
  3. Edit the build.chainsaw.properties file and modify to suit your needs.  In particular
    * Ensure the "Library Path Stuff" section contains correct relative/full paths to the
      relevant libraries (You might need to source these from the 'Net)
    
    * Ensure the log4j.core.jar is set to the relative/full path to an existing log4j core 
      jar file.  At this point we recommend actually downloading the jakarta-log4j module 
      and running the "jar" target to generate the jar (don't 
      forget to point the log4j.core.jar property in build.chainsaw.properties to 
      this file!)
      
      **** Notes: the intent of the chainsaw-build.xml file is to be able to get it to 
             automatically do the external Ant call for you, but for now, 
             it's not operational - please provide the log4j-core jar.
    
    * Ensure the log4j.configuration.dir property points to a relevant directory, and
      there is a valid Log4j xml configuration file in there. Also ensure that the
      log4j.configuration property is set to that configuration file name.
      
      **** Notes: See the src/config/log4j-sample.xml for a sample configuration that
      should receive events from Sockets on the standard 4445 port, and funnel
      into Chainsaw2.
    
  4. From the jakarta-log4j-sandbox root directory, type:
  
        ant -f chainsaw-build.xml
      
     This should run all the relevant targets and you should see Chainsaw2, with some in-
     progress documentation! (apoligise for the poor documentation so far...We're working on
     it!)  
     
  Once the application you have generating Log4j starts streaming them to an appropriate
  SocketAppender targetted to the IP address of your local machine, you should see
  a new Tab appear (maybe title 'Unknown').  Click on this tab to view your Events!
     
  Notes:
  ======
  The chainsaw-build.xml script compiles and updates some of the log4j-core functionality.
  The log4j-core jar that is used (either provided, or built using an automated external Ant
  call) is updated with the changed files to ensure this new version of Chainsaw works.
  
  These changes to the log4-core are currently being reviewed by the Dev community and
  should soon be included in the main jakarta-log4 module in some format shortly (cross
  fingers).
  
  Once these changes have been integrated into the core, we will remove the need for this
  update to an external jar.  We're just trying to simulate as much as possible real world
  conditions.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org