logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j/rule ExpressionRuleContext.java RuleTest.java
Date Sun, 02 Jan 2005 09:51:41 GMT
sdeboy      2005/01/02 01:51:40

  Modified:    src/java/org/apache/log4j/chainsaw
                        ChainsawToolBarAndMenus.java LogPanel.java
                        LogUI.java
               src/java/org/apache/log4j/chainsaw/color ColorPanel.java
               .        build.properties.sample build.xml
  Added:       src/java/org/apache/log4j/chainsaw
                        ExpressionRuleContext.java
               src/java/org/apache/log4j/filters ReflectionFilter.java
                        PropertyFilter.java DenyAllFilter.java
                        MapFilter.java ExpressionFilter.java
                        LocationInfoFilter.java LevelMatchFilter.java
                        StringMatchFilter.java LevelRangeFilter.java
               .        build-chainsaw.xml
  Removed:     src/java/org/apache/log4j/varia LocationInfoFilter.java
                        MapFilter.java LevelRangeFilter.java
                        ReflectionFilter.java ExpressionFilter.java
                        StringMatchFilter.java PropertyFilter.java
                        DenyAllFilter.java LevelMatchFilter.java
               src/java/org/apache/log4j/rule ExpressionRuleContext.java
                        RuleTest.java
  Log:
  Modifying log4j ant scripts:
  build.xml
  - Changed compile directory from /dist/classes to /classes
  - Created new target: build.requiredeps - fails if all deps are not present
  - Created new Chainsaw-specific ant script and moved Chainsaw-specific targets to: build-chainsaw.xml
  - Added forwarding targets from build.xml to build-chainsaw.xml to continue to support jar/running of Chainsaw
  - ORO dependency specified in build.xml
  - ORO-dependent classes now included in log4j jar if ORO jar available on classpath
  build.properties.sample
  - Added property for vfs.jar to support the compile of o.a.l.chainsaw.VFSLogFilePatternReceiver
  build-chainsaw.xml
  - VFSLogFilePatternReceiver now included in Chainsaw jar if vfs jar is available on classpath
  
  Code organization changes:
  Filters moved from o.a.l.varia to o.a.l.filters
  Moved Chainsaw-specific rule context menu class to chainsaw package
  
  Revision  Changes    Path
  1.48      +0 -1      logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
  
  Index: ChainsawToolBarAndMenus.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- ChainsawToolBarAndMenus.java	2 Sep 2004 00:30:19 -0000	1.47
  +++ ChainsawToolBarAndMenus.java	2 Jan 2005 09:51:40 -0000	1.48
  @@ -57,7 +57,6 @@
   import org.apache.log4j.chainsaw.help.HelpManager;
   import org.apache.log4j.chainsaw.icons.ChainsawIcons;
   import org.apache.log4j.chainsaw.receivers.ReceiversHelper;
  -import org.apache.log4j.rule.ExpressionRuleContext;
   
   
   /**
  
  
  
  1.94      +0 -1      logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java
  
  Index: LogPanel.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- LogPanel.java	7 Dec 2004 09:34:59 -0000	1.93
  +++ LogPanel.java	2 Jan 2005 09:51:40 -0000	1.94
  @@ -128,7 +128,6 @@
   import org.apache.log4j.helpers.Constants;
   import org.apache.log4j.helpers.ISO8601DateFormat;
   import org.apache.log4j.rule.ExpressionRule;
  -import org.apache.log4j.rule.ExpressionRuleContext;
   import org.apache.log4j.rule.Rule;
   import org.apache.log4j.spi.LoggingEvent;
   import org.apache.log4j.spi.LoggingEventFieldResolver;
  
  
  
  1.116     +0 -3      logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- LogUI.java	28 Dec 2004 08:14:34 -0000	1.115
  +++ LogUI.java	2 Jan 2005 09:51:40 -0000	1.116
  @@ -52,7 +52,6 @@
   import java.util.List;
   import java.util.Map;
   import java.util.Set;
  -
   import javax.swing.AbstractAction;
   import javax.swing.Action;
   import javax.swing.BorderFactory;
  @@ -83,7 +82,6 @@
   import javax.swing.event.EventListenerList;
   import javax.swing.event.HyperlinkEvent;
   import javax.swing.event.HyperlinkListener;
  -
   import org.apache.log4j.AppenderSkeleton;
   import org.apache.log4j.Level;
   import org.apache.log4j.LogManager;
  @@ -114,7 +112,6 @@
   import org.apache.log4j.rule.Rule;
   import org.apache.log4j.spi.Decoder;
   import org.apache.log4j.spi.LoggingEvent;
  -import org.apache.log4j.varia.PropertyFilter;
   import org.apache.log4j.xml.XMLDecoder;
   
   
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/chainsaw/ExpressionRuleContext.java
  
  Index: ExpressionRuleContext.java
  ===================================================================
  /*
   * Copyright 1999,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.
   */
  
  package org.apache.log4j.chainsaw;
  
  import java.awt.Point;
  import java.awt.event.InputEvent;
  import java.awt.event.KeyAdapter;
  import java.awt.event.KeyEvent;
  import java.awt.event.MouseAdapter;
  import java.awt.event.MouseEvent;
  
  import javax.swing.DefaultListModel;
  import javax.swing.JList;
  import javax.swing.JPopupMenu;
  import javax.swing.JScrollPane;
  import javax.swing.JTextField;
  import javax.swing.ListModel;
  
  import org.apache.log4j.chainsaw.filter.FilterModel;
  import org.apache.log4j.rule.RuleFactory;
  import org.apache.log4j.spi.LoggingEventFieldResolver;
  
  /**
   * A popup menu which assists in building expression rules.  Completes event keywords, operators and 
   * context if available.
   * 
   * @author Scott Deboy <sdeboy@apache.org>
   */
  public class ExpressionRuleContext extends KeyAdapter {
    RuleFactory factory = RuleFactory.getInstance();
    LoggingEventFieldResolver resolver = LoggingEventFieldResolver.getInstance();
    JPopupMenu contextMenu = new JPopupMenu();
    JList list = new JList();
    FilterModel filterModel;
    JScrollPane scrollPane = new JScrollPane(list);
    final JTextField textField;
    private DefaultListModel fieldModel = new DefaultListModel();
    private DefaultListModel operatorModel = new DefaultListModel();
  
    public ExpressionRuleContext(
      final FilterModel filterModel, final JTextField textField) {
      this.filterModel = filterModel;
      this.textField = textField;
      fieldModel.addElement("LOGGER");
      fieldModel.addElement("LEVEL");
      fieldModel.addElement("CLASS");
      fieldModel.addElement("FILE");
      fieldModel.addElement("LINE");
      fieldModel.addElement("METHOD");
      fieldModel.addElement("MSG");
      fieldModel.addElement("NDC");
      fieldModel.addElement("EXCEPTION");
      fieldModel.addElement("TIMESTAMP");
      fieldModel.addElement("THREAD");
      fieldModel.addElement("PROP.");
  
      operatorModel.addElement("&&");
      operatorModel.addElement("||");
      operatorModel.addElement("!");
      operatorModel.addElement("!=");
      operatorModel.addElement("==");
      operatorModel.addElement("~=");
      operatorModel.addElement("LIKE");
      operatorModel.addElement("EXISTS");
      operatorModel.addElement("<");
      operatorModel.addElement(">");
      operatorModel.addElement("<=");
      operatorModel.addElement(">=");
  
      //make long to avoid scrollbar 
      list.setVisibleRowCount(13);
  
      PopupListener popupListener = new PopupListener();
      textField.addMouseListener(popupListener);
  
      list.addKeyListener(
        new KeyAdapter() {
          public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
              String value = list.getSelectedValue().toString();
              String contextKey = getContextKey();
              if (contextKey != null && (!(contextKey.endsWith(".")))) {
                value = "'"+value+"'";
              }
                  
              updateField(value);              
              contextMenu.setVisible(false);
            }
          }
        });
  
      list.addMouseListener(
        new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
              String value = list.getSelectedValue().toString();
              String contextKey = getContextKey();
              if (contextKey != null && (!(contextKey.endsWith(".")))) {
                value = "'"+value+"'";
              }
              
              updateField(value);
              contextMenu.setVisible(false);
            }
          }
        });
  
      contextMenu.insert(scrollPane, 0);
    }
  
    private void updateField(String value) {
      if (textField.getSelectedText() == null) {
          if (!(value.endsWith("."))) {
              value = value + " ";
          }
      }
  
      textField.replaceSelection(value);
    }
  
    public void keyPressed(KeyEvent e) {
      if (
        (e.getKeyCode() == KeyEvent.VK_SPACE)
          && (e.getModifiers() == InputEvent.CTRL_MASK)) {
        displayContext();
      }
    }
  
    public void displayContext() {
      String lastField = getContextKey();
  
      if (lastField != null) {
        ListModel model = filterModel.getContainer().getModel(lastField);
        if (model == null) {
          return;
        }
        list.setModel(model);
        list.setSelectedIndex(0);
  
        Point p = textField.getCaret().getMagicCaretPosition();
        contextMenu.doLayout();
        contextMenu.show(textField, p.x, (p.y + (textField.getHeight() - 5)));
        list.requestFocus();
      } else {
        if (isOperatorContextValid()) {
          list.setModel(operatorModel);
          list.setSelectedIndex(0);
  
          Point p = textField.getCaret().getMagicCaretPosition();
          contextMenu.doLayout();
          contextMenu.show(textField, p.x, (p.y + (textField.getHeight() - 5)));
          list.requestFocus();
        } else if (isFieldContextValid()) {
          list.setModel(fieldModel);
          list.setSelectedIndex(0);
  
          Point p = textField.getCaret().getMagicCaretPosition();
  
          if (p == null) {
            p = new Point(
                textField.getLocation().x,
                (textField.getLocation().y - textField.getHeight() + 5));
          }
          contextMenu.doLayout();
          contextMenu.show(textField, p.x, (p.y + (textField.getHeight() - 5)));
          list.requestFocus();
        }
      }
    }
  
    private boolean isFieldContextValid() {
      String text = textField.getText();
      int currentPosition = textField.getSelectionStart();
  
      return ((currentPosition == 0)
      || (text.charAt(currentPosition - 1) == ' '));
    }
  
    private String getContextKey() {
      String field = getField();
  
      if (field == null) {
        field = getSubField();
      }
  
      return field;
    }
  
    private boolean isOperatorContextValid() {
      String text = textField.getText();
  
      int currentPosition = textField.getSelectionStart();
  
      if ((currentPosition < 1) || (text.charAt(currentPosition - 1) != ' ')) {
        return false;
      }
  
      int lastFieldPosition = text.lastIndexOf(" ", currentPosition - 1);
  
      if (lastFieldPosition == -1) {
        return false;
      }
  
      int lastFieldStartPosition =
        Math.max(0, text.lastIndexOf(" ", lastFieldPosition - 1));
      String field =
        text.substring(lastFieldStartPosition, lastFieldPosition).toUpperCase()
            .trim();
  
      if (resolver.isField(field)) {
        return true;
      }
  
      return false;
    }
  
    //returns the currently active field which can be used to display a context menu
    //the field returned is the left hand portion of an expression (for example, logger == )
    //logger is the field that is returned
    private String getField() {
      String text = textField.getText();
  
      int currentPosition = textField.getSelectionStart();
  
      if ((currentPosition < 1) || (text.charAt(currentPosition - 1) != ' ')) {
        return null;
      }
  
      int symbolPosition = text.lastIndexOf(" ", currentPosition - 1);
  
      if (symbolPosition < 0) {
        return null;
      }
  
      int lastFieldPosition = text.lastIndexOf(" ", symbolPosition - 1);
  
      if (lastFieldPosition < 0) {
        return null;
      }
  
      int lastFieldStartPosition =
        Math.max(0, text.lastIndexOf(" ", lastFieldPosition - 1));
      String lastSymbol =
        text.substring(lastFieldPosition + 1, symbolPosition).trim();
  
      String lastField =
        text.substring(lastFieldStartPosition, lastFieldPosition).trim();
  
      if (
        factory.isRule(lastSymbol)
          && filterModel.getContainer().modelExists(lastField)) {
        return lastField;
      }
  
      return null;
    }
  
    //subfields allow the key portion of a field to provide context menu support
    //and are available after the fieldname and a . (for example, PROP.)
    private String getSubField() {
      int currentPosition = textField.getSelectionStart();
      String text = textField.getText();
  
      if (text.substring(0, currentPosition).toUpperCase().endsWith("PROP.")) {
        return "PROP.";
      }
      return null;
    }
  
    class PopupListener extends MouseAdapter {
      PopupListener() {
      }
  
      public void mousePressed(MouseEvent e) {
        checkPopup(e);
      }
  
      public void mouseReleased(MouseEvent e) {
        checkPopup(e);
      }
  
      private void checkPopup(MouseEvent e) {
        if (e.isPopupTrigger()) {
          displayContext();
        }
      }
    }
  }
  
  
  
  1.17      +1 -1      logging-log4j/src/java/org/apache/log4j/chainsaw/color/ColorPanel.java
  
  Index: ColorPanel.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/color/ColorPanel.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ColorPanel.java	2 Aug 2004 06:01:22 -0000	1.16
  +++ ColorPanel.java	2 Jan 2005 09:51:40 -0000	1.17
  @@ -64,11 +64,11 @@
   import javax.swing.table.DefaultTableModel;
   import javax.swing.table.TableCellRenderer;
   
  +import org.apache.log4j.chainsaw.ExpressionRuleContext;
   import org.apache.log4j.chainsaw.filter.FilterModel;
   import org.apache.log4j.chainsaw.icons.ChainsawIcons;
   import org.apache.log4j.rule.ColorRule;
   import org.apache.log4j.rule.ExpressionRule;
  -import org.apache.log4j.rule.ExpressionRuleContext;
   import org.apache.log4j.rule.Rule;
   
   
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/ReflectionFilter.java
  
  Index: ReflectionFilter.java
  ===================================================================
  /*
   * Copyright 1999,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.
   */
  
  package org.apache.log4j.filters;
  
  import java.beans.IntrospectionException;
  import java.beans.Introspector;
  import java.beans.PropertyDescriptor;
  import java.lang.reflect.InvocationTargetException;
  import java.util.Hashtable;
  import java.util.Map;
  
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  public class ReflectionFilter extends Filter {
  
  	/**
  	 * NOTE: This filter modifies logging events by adding   
  	 * properties to the event.
  	 * 
  	 * The object passed in as the message must provide a message via toString 
  	 * or provide a 'message' property, which will be set as the rendered message.
  	 * 
  	 * This ReflectionFilter uses the JavaBeans BeanInfo and PropertyDescriptor mechanisms to discover 
  	 * readMethods available on the 'message' object provided by the event.
  	 *  
  	 * For each method available on the object via the BeanInfo PropertyDescriptors, the method is executed
  	 * and a property is added to the event, using the results of the method call as the value 
  	 * and the method name as the key.
  	 * 
  	 * @since 1.3
  	 */
  	public int decide(LoggingEvent event) {
  		Map properties = event.getProperties();
  		Hashtable eventProps = null;
  		if (properties == null) {
  			eventProps = new Hashtable();
  		} else {
  			eventProps = new Hashtable(properties);
  		}
  	
  		//ignore strings and the object class properties
  		if (!(event.getMessage() instanceof String)) {
  			PropertyDescriptor[] props;
  			try {
  				props = Introspector.getBeanInfo(event.getMessage().getClass(), Object.class).getPropertyDescriptors();
  				for (int i=0;i<props.length;i++) {
  					if ("message".equalsIgnoreCase(props[i].getName())) {
  						event.setRenderedMessage(props[i].getReadMethod().invoke(event.getMessage(), null).toString());
  					} else {
  						eventProps.put(props[i].getName(), props[i].getReadMethod().invoke(event.getMessage(), null).toString());
  					}
  				}
  				event.setProperties(eventProps);
  			} catch (IntrospectionException e) {
  				e.printStackTrace();
  			} catch (IllegalArgumentException e1) {
  				e1.printStackTrace();
  			} catch (IllegalAccessException e1) {
  				e1.printStackTrace();
  			} catch (InvocationTargetException e1) {
  				e1.printStackTrace();
  			}
  		}
  		return Filter.NEUTRAL;
  	}
  }
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/PropertyFilter.java
  
  Index: PropertyFilter.java
  ===================================================================
  /*
   * Copyright 1999,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.
   */
  
  package org.apache.log4j.filters;
  
  import java.util.Hashtable;
  import java.util.Iterator;
  import java.util.Map;
  import java.util.StringTokenizer;
  
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  /**
   * NOTE: This filter modifies logging events by adding properties to the event.
   * 
   * The 'properties' param is converted to event properties, which are 
   * set on every event processed by the filter.
   * 
   * Individual properties are only set if they do not already exist on the 
   * logging event (will not override existing properties).
   * 
   * This class relies on the convention that property name/value pairs are 
   * equals-symbol delimited, and each name/value pair is comma-delimited
   * 
   * Example properties param:
   * somename=somevalue,anothername=anothervalue,thirdname=third value
   * 
   * @since 1.3
   */
  public class PropertyFilter extends Filter {
  	private Hashtable properties;
  	public void setProperties(String props) {
  		properties = parseProperties(props);
  	}
  	
  	public int decide(LoggingEvent event) {
  		Map eventProps = event.getProperties();
  		if (eventProps == null) {
  			event.setProperties(new Hashtable(properties));
  		} else {
  		    //only add properties that don't already exist
  		    for (Iterator iter = properties.keySet().iterator();iter.hasNext();) {
  		        Object key = iter.next();
  		        if (!(eventProps.containsKey(key))) {
  		            eventProps.put(key, properties.get(key));
  		        }
  		    }
  		}
  		return Filter.NEUTRAL;
  	}
  	
  	private Hashtable parseProperties(String props) {
  		Hashtable hashTable = new Hashtable();
  		StringTokenizer pairs = new StringTokenizer(props, ",");
  		while (pairs.hasMoreTokens()) {
  			StringTokenizer entry = new StringTokenizer(pairs.nextToken(), "=");
  			hashTable.put(entry.nextElement().toString().trim(), entry.nextElement().toString().trim());
  		}
  		return hashTable;
  	}
  }
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/DenyAllFilter.java
  
  Index: DenyAllFilter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  
  package org.apache.log4j.filters;
  
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  
  /**
     This filter drops all logging events. 
  
     <p>You can add this filter to the end of a filter chain to
     switch from the default "accept all unless instructed otherwise"
     filtering behaviour to a "deny all unless instructed otherwise"
     behaviour.
  
  
     @author Ceki G&uuml;lc&uuml;
  
     @since 0.9.0 */
  public class DenyAllFilter extends Filter {
  
    /**
       Returns <code>null</code> as there are no options.
       
       @deprecated We now use JavaBeans introspection to configure
       components. Options strings are no longer needed.
    */
    public
    String[] getOptionStrings() {
      return null;
    }
  
    
    /**
       No options to set.
       
       @deprecated Use the setter method for the option directly instead
       of the generic <code>setOption</code> method. 
    */
    public
    void setOption(String key, String value) {
    }
    
    /**
       Always returns the integer constant {@link Filter#DENY}
       regardless of the {@link LoggingEvent} parameter.
  
       @param event The LoggingEvent to filter.
       @return Always returns {@link Filter#DENY}.
    */
    public
    int decide(LoggingEvent event) {
      return Filter.DENY;
    }
  }
  
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/MapFilter.java
  
  Index: MapFilter.java
  ===================================================================
  /*
   * Copyright 1999,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.
   */
  
  package org.apache.log4j.filters;
  
  import java.util.Hashtable;
  import java.util.Iterator;
  import java.util.Map;
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  public class MapFilter extends Filter {
  
  	/**
  	 * NOTE: This filter modifies logging events by adding properties to the event.
  	 * 
  	 * The object passed in as the event message must implement java.util.Map.
     * 
     * This filter converts the event message (a Map) into properties on the event.
     * 
     * If the map holds an entry with a key of "message", the value of the entry is used
     * as the rendered message.
     * 
  	 * @since 1.3
  	 */
  	public int decide(LoggingEvent event) {
  		Map properties = event.getProperties();
  		Hashtable eventProps = null;
  		if (properties == null) {
  			eventProps = new Hashtable();
  		} else {
  			eventProps = new Hashtable(properties);
  		}
  	
  		if (event.getMessage() instanceof Map) {
  			for (Iterator iter = ((Map)event.getMessage()).entrySet().iterator();iter.hasNext();) {
          Map.Entry entry = (Map.Entry)iter.next();
  				if ("message".equalsIgnoreCase(entry.getKey().toString())) {
  					event.setRenderedMessage(entry.getValue().toString());
  				} else {
  					eventProps.put(entry.getKey(), entry.getValue());
  				}
  			}
  			event.setProperties(eventProps);
  		}
  		return Filter.NEUTRAL;
  	}
  }
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/ExpressionFilter.java
  
  Index: ExpressionFilter.java
  ===================================================================
  /*
   * Copyright 1999,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.
   */
  
  package org.apache.log4j.filters;
  
  import org.apache.log4j.rule.ExpressionRule;
  import org.apache.log4j.rule.Rule;
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  
  /**
   *A filter supporting complex expressions - supports both infix and postfix expressions 
   *(infix expressions must first be converted to postfix prior to processing).
   *
   *See <code>org.apache.log4j.chainsaw.LoggingEventFieldResolver.java</code> 
   *for the correct names for logging event fields used when building expressions.
   *
   *See <org.apache.log4j.chainsaw.rule</code> package for a list of available rules which can
   *be applied using the expression syntax.
   *
   *See <code>org.apache.log4j.chainsaw.RuleFactory</code> for the symbols used to 
   *activate the corresponding rules.
   *
   *NOTE:  Grouping using parentheses is supported - all tokens must be separated by spaces, and
   *operands which contain spaces are not yet supported.
   *
   *Example:
   *
   *In order to build a filter that displays all messages with infomsg-45 or infomsg-44 in the message,
   *as well as all messages with a level of WARN or higher, build an expression using 
   *the LikeRule (supports ORO-based regular expressions) and the InequalityRule. 
   * <b> ( MSG LIKE infomsg-4[4,5] ) && ( LEVEL >= WARN ) </b>
   *  
   *Three options are required:
   *  <b>Expression</b> - the expression to match
   *  <b>ConvertInFixToPostFix</b> - convert from infix to posfix (default true)
   *  <b>AcceptOnMatch</b> - true or false (default true)
   *
   * Meaning of <b>AcceptToMatch</b>:
   * If there is a match between the value of the
   * Expression option and the {@link LoggingEvent} and AcceptOnMatch is true,
   * the {@link #decide} method returns {@link Filter#ACCEPT}.
   *
   * If there is a match between the value of the
   * Expression option and the {@link LoggingEvent} and AcceptOnMatch is false,
   * {@link Filter#DENY} is returned.
   *
   * If there is no match, {@link Filter#NEUTRAL} is returned.
   *
   * @author Scott Deboy sdeboy@apache.org
   */
  public class ExpressionFilter extends Filter {
    boolean acceptOnMatch = true;
    boolean convertInFixToPostFix = true;
    String expression;
    Rule expressionRule;
  
    public void activateOptions() {
      expressionRule =
        ExpressionRule.getRule(expression, !convertInFixToPostFix);
    }
  
    public void setExpression(String expression) {
      this.expression = expression;
    }
  
    public String getExpression() {
      return expression;
    }
  
    public void setConvertInFixToPostFix(boolean convertInFixToPostFix) {
      this.convertInFixToPostFix = convertInFixToPostFix;
    }
  
    public boolean getConvertInFixToPostFix() {
      return convertInFixToPostFix;
    }
  
    public void setAcceptOnMatch(boolean acceptOnMatch) {
      this.acceptOnMatch = acceptOnMatch;
    }
  
    public boolean getAcceptOnMatch() {
      return acceptOnMatch;
    }
  
    /**
       Returns {@link Filter#NEUTRAL} is there is no string match.
     */
    public int decide(LoggingEvent event) {
      if (expressionRule.evaluate(event)) {
        return (acceptOnMatch?Filter.ACCEPT:Filter.DENY);
      }
      return Filter.NEUTRAL;
    }
  }
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/LocationInfoFilter.java
  
  Index: LocationInfoFilter.java
  ===================================================================
  /*
   * Copyright 1999,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.
   */
  
  package org.apache.log4j.filters;
  
  import org.apache.log4j.rule.ExpressionRule;
  import org.apache.log4j.rule.Rule;
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  import org.apache.log4j.spi.location.LocationInfo;
  
  
  /**
   * Location information is usually specified at the appender level - all events associated 
   * with an appender either create and parse stack traces or they do not.  This is
   * an expensive operation and in some cases not needed for all events associated with
   * an appender.
   * 
   * This filter creates event-level location information only if the provided expression evaluates to true.
   * 
   * For information on expression syntax, see org.apache.log4j.rule.ExpressionRule
   * 
   * @author Scott Deboy sdeboy@apache.org
   */
  public class LocationInfoFilter extends Filter {
    boolean convertInFixToPostFix = true;
    String expression;
    Rule expressionRule;
    //HACK: Category is the last of the internal layers - pass this in as the class name
    //in order for parsing to work correctly
    private String className = "org.apache.log4j.Category";
  
    public void activateOptions() {
      expressionRule =
        ExpressionRule.getRule(expression, !convertInFixToPostFix);
    }
  
    public void setExpression(String expression) {
      this.expression = expression;
    }
  
    public String getExpression() {
      return expression;
    }
  
    public void setConvertInFixToPostFix(boolean convertInFixToPostFix) {
      this.convertInFixToPostFix = convertInFixToPostFix;
    }
  
    public boolean getConvertInFixToPostFix() {
      return convertInFixToPostFix;
    }
  
    /**
     * If this event does not already contain location information, 
     * evaluate the event against the expression.
     * 
     * If the expression evaluates to true, generate a LocationInfo instance 
     * by creating an exception and set this LocationInfo on the event.
     * 
     * Returns {@link Filter#NEUTRAL}
     */
    public int decide(LoggingEvent event) {
      if (!event.locationInformationExists()) {
        if (expressionRule.evaluate(event)) {
  	      Throwable t = new Exception();
  	      event.setLocationInformation(new LocationInfo(t, className));
        }
      }
      return Filter.NEUTRAL;
    }
  }
  
  
  
  1.5       +77 -40    logging-log4j/src/java/org/apache/log4j/filters/LevelMatchFilter.java
  
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/StringMatchFilter.java
  
  Index: StringMatchFilter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  
  package org.apache.log4j.filters;
  
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  /**
     This is a very simple filter based on string matching.
     
  
     <p>The filter admits two options <b>StringToMatch</b> and
     <b>AcceptOnMatch</b>. If there is a match between the value of the
     StringToMatch option and the message of the {@link LoggingEvent},
     then the {@link #decide} method returns {@link Filter#ACCEPT} if
     the <b>AcceptOnMatch</b> option value is true, if it is false then
     {@link Filter#DENY} is returned. If there is no match, {@link
     Filter#NEUTRAL} is returned.
  
     @author Ceki G&uuml;lc&uuml;
  
     @since 0.9.0 */
  public class StringMatchFilter extends Filter {
    
    boolean acceptOnMatch = true;
    String stringToMatch;
    
    public
    void setStringToMatch(String s) {
      stringToMatch = s;
    }
    
    public
    String getStringToMatch() {
      return stringToMatch;
    }
    
    public
    void setAcceptOnMatch(boolean acceptOnMatch) {
      this.acceptOnMatch = acceptOnMatch;
    }
    
    public
    boolean getAcceptOnMatch() {
      return acceptOnMatch;
    }
  
    /**
       Returns {@link Filter#NEUTRAL} is there is no string match.
     */
    public
    int decide(LoggingEvent event) {
      String msg = event.getRenderedMessage();
  
      if(msg == null ||  stringToMatch == null)
        return Filter.NEUTRAL;
      
  
      if( msg.indexOf(stringToMatch) == -1 ) {
        return Filter.NEUTRAL;
      } else { // we've got a match
        if(acceptOnMatch) {
  	return Filter.ACCEPT;
        } else {
  	return Filter.DENY;
        }
      }
    }
  }
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/filters/LevelRangeFilter.java
  
  Index: LevelRangeFilter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software
   * License version 1.1, a copy of which has been included with this
   * distribution in the LICENSE.txt file.  */
  
  package org.apache.log4j.filters;
  
  import org.apache.log4j.Level;
  import org.apache.log4j.spi.Filter;
  import org.apache.log4j.spi.LoggingEvent;
  
  /**
     This is a very simple filter based on level matching, which can be
     used to reject messages with priorities outside a certain range.
     
     <p>The filter admits three options <b>LevelMin</b>, <b>LevelMax</b>
     and <b>AcceptOnMatch</b>.
  
     <p>If the level of the {@link LoggingEvent} is not between Min and Max
     (inclusive), then {@link Filter#DENY} is returned.
     
     <p> If the Logging event level is within the specified range, then if
     <b>AcceptOnMatch</b> is true, {@link Filter#ACCEPT} is returned, and if
     <b>AcceptOnMatch</b> is false, {@link Filter#NEUTRAL} is returned.
     
     <p>If <code>LevelMin</code>w is not defined, then there is no
     minimum acceptable level (ie a level is never rejected for
     being too "low"/unimportant).  If <code>LevelMax</code> is not
     defined, then there is no maximum acceptable level (ie a
     level is never rejected for beeing too "high"/important).
  
     <p>Refer to the {@link
     org.apache.log4j.AppenderSkeleton#setThreshold setThreshold} method
     available to <code>all</code> appenders extending {@link
     org.apache.log4j.AppenderSkeleton} for a more convenient way to
     filter out events by level.
  
     @author Simon Kitching
     @author based on code by Ceki G&uuml;lc&uuml; 
  */
  public class LevelRangeFilter extends Filter {
  
    /**
       Do we return ACCEPT when a match occurs. Default is
       <code>false</code>, so that later filters get run by default  */
    boolean acceptOnMatch = false;
  
    Level levelMin;
    Level levelMax;
  
   
    /**
       Return the decision of this filter.
     */
    public
    int decide(LoggingEvent event) {
      if(this.levelMin != null) {
        if (event.getLevel().isGreaterOrEqual(levelMin) == false) {
          // level of event is less than minimum
          return Filter.DENY;
        }
      }
  
      if(this.levelMax != null) {
        if (event.getLevel().toInt() > levelMax.toInt()) {
          // level of event is greater than maximum
          // Alas, there is no Level.isGreater method. and using
          // a combo of isGreaterOrEqual && !Equal seems worse than
          // checking the int values of the level objects..
          return Filter.DENY;
        }
      }
  
      if (acceptOnMatch) {
        // this filter set up to bypass later filters and always return
        // accept if level in range
        return Filter.ACCEPT;
      }
      else {
        // event is ok for this filter; allow later filters to have a look..
        return Filter.NEUTRAL;
      }
    }
  
   /**
       Get the value of the <code>LevelMax</code> option.  */
    public
    Level getLevelMax() {
      return levelMax;
    }
  
  
    /**
       Get the value of the <code>LevelMin</code> option.  */
    public
    Level getLevelMin() {
      return levelMin;
    }
  
    /**
       Get the value of the <code>AcceptOnMatch</code> option.
     */
    public
    boolean getAcceptOnMatch() {
      return acceptOnMatch;
    }
  
    /**
       Set the <code>LevelMax</code> option.
     */
    public
    void setLevelMax(Level levelMax) {
      this.levelMax =  levelMax;
    }
  
    /**
       Set the <code>LevelMin</code> option.
     */
    public
    void setLevelMin(Level levelMin) {
      this.levelMin =  levelMin;
    }
  
    /**
       Set the <code>AcceptOnMatch</code> option.
     */  
    public 
    void setAcceptOnMatch(boolean acceptOnMatch) {
      this.acceptOnMatch = acceptOnMatch;
    }
  }
  
  
  
  
  1.21      +14 -5     logging-log4j/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/logging-log4j/build.properties.sample,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- build.properties.sample	15 Dec 2004 22:32:27 -0000	1.20
  +++ build.properties.sample	2 Jan 2005 09:51:40 -0000	1.21
  @@ -28,12 +28,21 @@
   # from the parent project.
   logging-site=../logging-site
   
  -# ===================================================================
  -# Chainsaw v2 specific
  -# ===================================================================
  -# describes the relative or full path to the Jakarta ORO Reg Exp jar file
  -# This is required if you wish to use Chainsaw v2
  +# Describes the relative or full path to the Jakarta ORO Reg Exp jar file
  +# Required if you wish to use LogFilePatternReceiver or LikeRule (regexp)
   #regexp.oro.jar=../oro/jakarta-oro-2.0.8.jar
  +
  +# Describes the path to the VFS jar (see http://jakarta.apache.org/commons/sandbox/vfs/)
  +# Required if you wish to compile the Chainsaw jar and include the 
  +# org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver virtual file system receiver
  +# to access log files in Chainsaw
  +#
  +# See http://jakarta.apache.org/commons/sandbox/vfs/filesystems.html 
  +# for a full description of supported file systems (ssh, zip, etc).
  +#
  +# See http://jakarta.apache.org/commons/sandbox/vfs/download.html for 
  +# file system-specific jars required when running Chainsaw with a VFSLogFilePatternReceiver
  +#vfs.jar=../vfs/commons-vfs-1.0-dev.jar
   
   # DBAppeder/DBReceiver OPTIONAL: 
   #
  
  
  
  1.126     +72 -229   logging-log4j/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/logging-log4j/build.xml,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- build.xml	31 Dec 2004 15:21:40 -0000	1.125
  +++ build.xml	2 Jan 2005 09:51:40 -0000	1.126
  @@ -20,7 +20,7 @@
     <property name="deprecation" value="on"/>
   	
     <!-- Destination for compiled files -->
  -  <property name="javac.dest" value="dist/classes"/>
  +  <property name="javac.dest" value="classes"/>
   
     <!-- Source directory for the examples/ -->
     <property name="examples.src" value="examples/src"/>
  @@ -34,12 +34,6 @@
     <!-- The jar file that the jar task will generate -->
     <property name="log4j.jar" value="log4j-${version}.jar"/>
   
  -  <!-- The jar file that the jar-chainsaw task will generate -->
  -  <property name="log4j-chainsaw.jar" value="log4j-chainsaw-${version}.jar"/>
  -
  -  <!-- When building a Java Web Start distribution of Chainsaw, some Receivers with external dependencies need to be packaged into a seperate Jar -->
  -  <property name="webstart-dependant-receivers.jar" value="webstart-dependant-receivers.jar-${version}.jar"/>
  -	
     <!-- Destination for documentation files -->
     <property name="docs.dest" value="./docs"/>
     <!-- Source directory for xml docs -->
  @@ -122,7 +116,7 @@
     <target name="jaxp" depends="jaxpCheck" if="jaxp-present">
       <echo message="JAXP present."/>
     </target>
  -
  +	
     <target name="jndiCheck">
       <available classname="javax.naming.Context" property="jndi-present">
         <classpath refid="compile.classpath"/>
  @@ -142,7 +136,7 @@
     </target>
   
     <target name="jmxCheck" depends="jndiCheck" if="jndi-present">
  -    <condition property="jmxCheck">
  +    <condition property="jmx-present">
            <and>
               <available classname="javax.management.MBeanInfo">
                <classpath refid="compile.classpath"/>
  @@ -158,11 +152,22 @@
       <echo message="JMX is present."/>
     </target>
   
  +  <target name="oroCheck" >
  +    <available classname="org.apache.oro.text.perl.Perl5Util" property="oro-present">
  +      <classpath refid="compile.classpath"/>
  +    </available>
  +  </target>
  +
  +  <target name="oro" depends="oroCheck" if="oro-present">
  +    <echo message="ORO is present."/>
  +  </target>
  +	  	
     <target name="jmsCheck" depends="jndiCheck" if="jndi-present">
       <available classname="javax.jms.Message" property="jms-present">
        <classpath refid="compile.classpath"/>
       </available>
     </target>
  +  	
     <target name="jms" depends="jmsCheck" if="jms-present">
       <echo message="JMS is present."/>
     </target>
  @@ -194,17 +199,35 @@
       <echo message="JDBC Standard Extension is present."/>
     </target>
   
  -
  -
     <target name="init">
       <tstamp />
     </target>
   
  -  <target name="build" description="Compile all log4j components."
  -          depends="init, build.core, build.examples, 
  -                   build.xml, build.javamail, build.jms, build.jmx, 
  -                   build.servletAPI, build.db, 
  -                   build.chainsaw"/>
  +	 <target name="build" description="Compile all log4j components."
  +	          depends="init, build.core, build.examples, 
  +	                   build.xml, build.javamail, build.jms, build.jmx, 
  +	                   build.servletAPI, build.db, build.oro, build.chainsaw"/>
  +
  +  <target name="build.requiredeps" 
  +  	depends="jndiCheck,jmsCheck,oroCheck,javamailCheck,servletAPICheck,jdbcExtensionCheck,jmxCheck,jaxpCheck"
  +  	description="Compile all log4j components - fail if dependencies do not exist"
  +  	>
  +    <condition property="alldeps.exist">
  +              <and>
  +                <isset property="jndi-present"/>
  +                <isset property="oro-present"/>
  +                <isset property="jms-present"/>
  +                <isset property="javamail-present"/>
  +                <isset property="servletAPI-present"/>         	
  +                <isset property="jdbcExtension-present"/>
  +                <isset property="jmx-present"/>         	
  +                <isset property="jaxp-present"/>         	
  +              </and>
  +          </condition>
  +          <fail unless="alldeps.exist">
  +              Some jar files required to perform a full compile of log4j are not available on the classpath.  Update build.properties as needed.
  +          </fail>	<antcall target="build"/>
  +  </target>
   
     <target name="build.core" depends="init, jndiCheck" if="jndi-present" >
       <mkdir dir="${javac.dest}" />
  @@ -215,17 +238,15 @@
        excludes="misc/*, **/UnitTest*.java,
                       **/StressCategory.java,
                       **/doc-files/*,
  -                    ${stem}/db/**,
  -                    ${stem}/chainsaw/**,
  +			        ${stem}/chainsaw/**,
  +			    	${stem}/db/**,
                       ${stem}/xml/**,
                       ${stem}/test/serialization/**,
                       ${stem}/net/SMTPAppender.java,
                       ${stem}/net/JMS*.java,
  +    	            ${stem}/varia/LogFilePatternReceiver*.java,
  +    	            ${stem}/rule/LikeRule.java,
                       ${stem}/jmx/*.java,
  -                    ${stem}/chainsaw/**/*.java,
  -                    ${stem}/rule/*.java,
  -                    ${stem}/varia/LogFilePatternReceiver*.java,
  -                    ${stem}/varia/ExpressionFilter.java,
                       ${stem}/or/jms/*.java,
                       ${stem}/selector/servlet/*.java"
         debug="${debug}">
  @@ -233,6 +254,18 @@
       </javac>
     </target>
   
  +  <target name="build.chainsaw">
  +	<ant antfile="build-chainsaw.xml" target="build.chainsaw"/>
  +  </target>	
  +  
  +  <target name="chainsaw.jar">
  +	<ant antfile="build-chainsaw.xml" target="chainsaw.jar"/>
  +  </target>	  
  +	 	
  +  <target name="chainsaw" depends="log4j.jar" description="Builds and runs Chainsaw v2" >
  +	<ant antfile="build-chainsaw.xml" target="chainsaw"/>
  +  </target>	
  +
    <!-- ================================================= -->
    <!--                Compile examples                   -->
    <!-- ================================================= -->
  @@ -276,7 +309,17 @@
       </javac>
     </target>
   
  -  <target name="build.jms" depends="init, jms, jndi" if="jms-present">
  +    <target name="build.oro" depends="init, oro" if="oro-present">
  +	  <javac srcdir="${java.source.dir}"
  +	    destdir="${javac.dest}"
  +        deprecation="${deprecation}"
  +	    includes="${stem}/varia/LogFilePatternReceiver*.java,
  +	    	      ${stem}/rule/LikeRule.java">
  +	     <classpath refid="compile.classpath"/>
  +	  </javac>
  +	</target>
  +
  +	<target name="build.jms" depends="init, jms, jndi" if="jms-present">
       <javac deprecation="${deprecation}"
              srcdir="${java.source.dir}"
       	   debug="${debug}"
  @@ -319,23 +362,6 @@
       </javac>
     </target>
     
  -  <target name="build.chainsaw" depends="init, chainsawCheck, build.core">
  -    <javac deprecation="${deprecation}"
  -           srcdir="${java.source.dir}"
  -    	   debug="${debug}"
  -           destdir="${javac.dest}">
  -  		   <patternset>
  -  		   	<include name="${stem}/chainsaw/**/*.java"/>
  -  		   	<include name="${stem}/rule/*.java"/>
  -  		   	<include name="${stem}/varia/ExpressionFilter.java"/>
  -  		    <include name="${stem}/varia/LogFilePatternReceiver*.java" if="chainsaw-libraries-present"/>
  -  			<exclude name="${stem}/chainsaw/vfs/*.java"/>
  -    	    <exclude name="${stem}/rule/LikeRule.java" unless="chainsaw-libraries-present"/>
  -  	       </patternset>
  -      <classpath refid="compile.classpath"/>   
  -    </javac>
  -  </target>
  -
     <!-- ================================================================= -->
     <!-- Remove all generated (compiled) class files.                      -->
     <!-- ================================================================= -->
  @@ -345,54 +371,9 @@
     </target>
   
     <!-- ================================================================= -->
  -  <!-- Define the set of files current styled                            -->
  -  <!-- ================================================================= -->
  -  <fileset dir="${java.source.dir}" id="styled_files">
  -    <include name="**/plugins/*.java"/>
  -    <include name="**/chainsaw/*.java"/>
  -  </fileset>
  -
  -  <target name="oroCheck" >
  -    <available classname="org.apache.oro.text.perl.Perl5Util" property="chainsaw-libraries-present">
  -      <classpath refid="compile.classpath"/>
  -    </available>
  -  	
  -  	<antcall target="oroWarning"/>
  -  	  
  -  </target>
  -
  -  <target name="oroWarning" unless="chainsaw-libraries-present">	
  -    <echo>
  -      Could not find jakarta-oro classes. Did you forget to set
  -"regexp.oro.jar" property in build.properties to point to
  -a valid jakarta.oro.jar file?  Chainsaw will be built but will
  -not include support for:
  -   the 'LIKE' (regular expression) rule
  -   LogFilePatternReceiver
  -    </echo>
  -  </target>
  -  	
  -  <target name="chainsawCheck" depends="oroCheck" if="chainsaw-libraries-present">
  -    <echo message="Chainsaw dependant libraries present."/>
  -  </target>
  -
  -  <!-- ================================================================= -->
  -  <!-- Runs Chainsaw                                                     -->
  -  <!-- ================================================================= -->
  -
  -  <target name="chainsaw" depends="build.chainsaw, log4j.jar, chainsaw.jar" description="Builds and runs Chainsaw v2" >
  -
  -    <!-- Need to fork to avoid problems -->
  -    <java classname="org.apache.log4j.chainsaw.LogUI" fork="yes"
  -          classpath="${jar.dest}/${log4j.jar};${jar.dest}/${log4j-chainsaw.jar};${jaxp.parser.jar};${regexp.oro.jar};${jms.jar}">
  -	<sysproperty key="log4j.debug" value="${log4j.debug}"/> 
  -    </java>
  -  </target>
  -
  -  <!-- ================================================================= -->
     <!-- Aactual work is done in the dependencies.                         -->
     <!-- ================================================================= -->
  -  <target name="jar" depends="log4j.jar, chainsaw.jar">
  +  <target name="jar" depends="log4j.jar">
     </target>
   
    <!-- ================================================================= -->
  @@ -416,6 +397,8 @@
   				${stem}/db/**/*.class,
   		        ${stem}/html/**/*.class,
                   ${stem}/varia/*.class,
  +                ${stem}/filters/*.class,    	
  +                ${stem}/rule/*.class,    	    	
                   ${stem}/nt/*.class,
                   ${stem}/rolling/**/*.class,
                   ${stem}/xml/*.class,
  @@ -428,9 +411,7 @@
                   ${stem}/or/jms/*.class,
                   ${stem}/plugins/*.class,
                   ${stem}/config/*.class"
  -      excludes="**/UnitTest**, ${stem}/**/*BeanInfo.class, ${stem}/varia/LogFilePatternReceiver*.class, ${stem}/varia/ExpressionFilter.class">
  -    	<exclude name="**/JMSReceiver*" if="webstart"/>
  -    	<exclude name="**/DBReceiver*" if="webstart"/>
  +      excludes="**/UnitTest**, ${stem}/**/*BeanInfo.class">
         <manifest>
           <attribute name="Manifest-version" value="1.0"/>
           <section name="org/apache/log4j/">
  @@ -444,132 +425,6 @@
   
   
     <!-- ================================================================= -->
  -  <!-- Create log4j-chainsaw.jar, excluding everything else              -->
  -  <!-- ================================================================= -->
  -  <target name="chainsaw.jar" depends="build">
  -    <delete>
  -      <fileset dir="${jar.dest}">
  -        <include name="${log4j-chainsaw.jar}"/>
  -      </fileset>
  -    </delete>
  -
  -    <copy todir="${javac.dest}">
  -      <fileset dir="src/java" includes="**/chainsaw/**/*.properties"/>
  -      <fileset dir="src/java" includes="**/chainsaw/*.properties"/>
  -      <fileset dir="src/java" includes="**/chainsaw/receivers/known.receivers"/>
  -      <fileset dir="src/java" includes="**/chainsaw/**/*.xml"/>   
  -      <fileset dir="src/java" includes="**/chainsaw/**/*.gif"/>
  -      <fileset dir="src/java" includes="**/chainsaw/**/*.html"/>
  -      <fileset dir="src/java" includes="**/chainsaw/*.jpg"/>   
  -      <fileset dir="src/java" includes="**/chainsaw/**/*.jpg"/>   
  -      <fileset dir="src/java" includes="**/chainsaw/**/LICENCE"/>   
  -    </copy>
  -
  -    <!-- JavaDoc up some Receiver and other stuff we want to be able to ship with Chainsaw-->
  -    <javadoc sourcepath="${java.source.dir}"
  -      destdir="${javac.dest}"
  -     version="true"
  -     author="true"
  -     use="true"
  -     overview="${jar.dest}/overview.html"
  -     doctitle="log4j version ${version}&lt;br&gt;API Specification"
  -     windowtitle="Log4j Version ${version}"
  -           header="&lt;b&gt;Log4j ${version}&lt;/b&gt;"
  -     bottom="Copyright 2000-2003 Apache Software Foundation."
  -        >
  -	    <fileset dir="src/java" defaultexcludes="yes">
  -	      <include name="**/*Receiver.java" />
  -	    </fileset>
  -        <classpath refid="compile.classpath"/>
  -        
  -    </javadoc>        
  -      
  -      
  -    <jar jarfile="${jar.dest}/${log4j-chainsaw.jar}" basedir="${javac.dest}"
  -         includes="${stem}/chainsaw/*.class,
  -                ${stem}/**/*.html,
  -                **/*.css,
  -                **/resources/*,
  -                ${stem}/varia/ExpressionFilter*.class,
  -                ${stem}/varia/LogFilePatternReceiver*.class,
  -            	${stem}/rule/*.class,
  -                ${stem}/**/*BeanInfo.class,
  -         		${stem}/chainsaw/**/*.class, 
  -          		${stem}/chainsaw/layout/*, 
  -         		${stem}/chainsaw/icons/*.gif, 
  -         		${stem}/chainsaw/*.jpg, 
  -         		${stem}/chainsaw/**/*.xml, 
  -         		${stem}/chainsaw/**/*.html, 
  -         		${stem}/chainsaw/**/*.properties, 
  -         		${stem}/chainsaw/receivers/known.receivers, 
  -         		${stem}/chainsaw/icons/*.jpg, 
  -         		${stem}/chainsaw/icons/LICENCE"
  -         excludes="**/UnitTest**">
  -    	<!-- we need to exclude the JMS + DB Receiver BeanInfo for webstart purposes -->
  -    	<exclude name="**/JMS*BeanInfo.class" if="webstart" />
  -    	<exclude name="**/DB*BeanInfo.class" if="webstart" />
  -      <manifest>
  -        <attribute name="Manifest-version" value="1.0"/>
  -        <section name="org/apache/log4j/">
  -          <attribute name="Implementation-Title" value="log4j"/>
  -          <attribute name="Implementation-Version" value="${version}"/>
  -          <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
  -        </section>
  -        <attribute name="Main-Class" value="org.apache.log4j.chainsaw.LogUI"/>
  -        <attribute name="Class-Path" value="${log4j.jar}"/>
  -      </manifest>
  -    </jar>
  -  </target>
  -
  -  <!-- ================================================================= -->
  -  <!-- These targets are for when we need to create a Java Web start distribution of Chainsaw -->
  -  <!-- ================================================================= -->
  -
  -  <target name="webstart-dependant-receivers.jar" depends="build">
  -    <delete>
  -      <fileset dir="${jar.dest}">
  -        <include name="${webstart-dependant-receivers.jar}"/>
  -      </fileset>
  -    </delete>
  -
  -    <jar jarfile="${jar.dest}/${webstart-dependant-receivers.jar}" basedir="${javac.dest}"
  -      includes="${stem}/**/JMSReceiver*.class, ${stem}/**/DBReceiver*.class">
  -      <manifest>
  -        <attribute name="Manifest-version" value="1.0"/>
  -        <section name="org/apache/log4j/">
  -          <attribute name="Implementation-Title" value="log4j"/>
  -          <attribute name="Implementation-Version" value="${version}"/>
  -          <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
  -        </section>
  -      </manifest>
  -    </jar>
  -  </target>
  -
  -	<target name="webstart" >
  -  	<property name="webstart" value="true"/>
  -  	 <antcall target="jar"/>
  - 	 <antcall target="webstart-dependant-receivers.jar"/>
  -		
  -		  <input
  -		    message="Please enter key password:"
  -		    addproperty="keypass"
  -		  />
  -		<signjar verbose="false" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" >
  -		 <fileset dir=".">
  -		  <include name="*.jar"/>
  -		 </fileset>
  -		</signjar>
  -		
  -		<zip destfile="chainsaw-bundle.zip" >
  -			<zipfileset dir="."> 
  -				<include name="*.jar"/>
  -			</zipfileset>
  -			<fileset file="${regexp.oro.jar}"/>
  -			<fileset file="src/chainsaw.bat"/>
  -		</zip>
  -  </target>
  -	
  -  <!-- ================================================================= -->
     <!-- This target builds the javadoc files.                             -->
     <!-- ================================================================= -->
     <target name="javadoc" depends="init">
  @@ -594,19 +449,8 @@
          org.apache.log4j.rolling.helper,
          org.apache.log4j.selector,
          org.apache.log4j.spi,
  +       org.apache.log4j.filters,
          org.apache.log4j.varia,
  -       org.apache.log4j.chainsaw,
  -       org.apache.log4j.chainsaw.color,
  -       org.apache.log4j.chainsaw.favourites,
  -       org.apache.log4j.chainsaw.filter,
  -       org.apache.log4j.chainsaw.help,
  -       org.apache.log4j.chainsaw.helper,
  -       org.apache.log4j.chainsaw.icons,
  -       org.apache.log4j.chainsaw.layout,
  -       org.apache.log4j.chainsaw.messages,
  -       org.apache.log4j.chainsaw.plugins,
  -       org.apache.log4j.chainsaw.prefs,
  -       org.apache.log4j.chainsaw.receivers,
          org.apache.log4j.rule,
          org.apache.log4j.xml,
          org.apache.log4j.xml.examples,
  @@ -725,8 +569,7 @@
                             build.properties.sample,
                             INSTALL,
                             LICENSE.txt,
  -                          ${log4j.jar},
  -                          ${log4j-chainsaw.jar}"
  +                          ${log4j.jar}"
                   excludes="**/*.bak, 
                            **/goEnv.bat,
                             docs/pub-support/*,
  
  
  
  1.1                  logging-log4j/build-chainsaw.xml
  
  Index: build-chainsaw.xml
  ===================================================================
  <project name="log4j" default="build" basedir="." >
  
  
    <!-- The build.properties file defines the parth to local jar files -->
    <property file="build.properties"/>
  
    <property name="version" value="1.3alpha-4"/>
  
    <!-- The base directory relative to which most targets are built -->
    <property name="base" value="."/>
  
    <!-- The directory where source files are stored. -->
    <property name="java.source.dir" value="src/java/"/>
  
    <!-- Deprecation warning? --> 
    <property name="deprecation" value="on"/>
  	
    <!-- Destination for compiled files -->
    <property name="javac.dest" value="classes"/>
  
    <!-- Destination for generated jar files -->
    <property name="jar.dest" value="${basedir}"/>
  
    <!-- The jar file that the jar task will generate -->
    <property name="log4j.jar" value="log4j-${version}.jar"/>
  
    <!-- The jar file that the jar-chainsaw task will generate -->
    <property name="log4j-chainsaw.jar" value="log4j-chainsaw-${version}.jar"/>
  
    <!-- When building a Java Web Start distribution of Chainsaw, some Receivers with external dependencies need to be packaged into a seperate Jar -->
    <property name="webstart-dependant-receivers.jar" value="webstart-dependant-receivers.jar-${version}.jar"/>
  	
    <!-- Javac with debug on/off. Log4j without debug on is hard to debug, so leave this settint on. -->
    <property name="debug" value="on"/>
  
    <!-- Destination for javadoc generated files -->
    <property name="javadoc.dest" value="docs/api"/>
  
    <!-- The stem where most log4j source code is located. -->
    <property name="stem" value="org/apache/log4j"/>
  
    <!-- Construct compile classpath -->
    <path id="compile.classpath">
      <pathelement location="${javac.dest}"/>
      <pathelement location="${log4j.jar}"/>
      <pathelement location="${vfs.jar}"/>
    </path>
  
    <!-- ================================================================= -->
    <!-- Default target                                                    -->
    <!-- ================================================================= -->
  
    <target name="usage">
      <echo>
  
      These are the targets supported by this ANT build scpript:
  
      build   - compile Chainsaw.  If a certain library is missing,
                then the compilation of its dependents are skipped.
  
      javadoc - build Chainsaw javadoc files
  
      jar     - build Chainsaw jar file
  
      </echo>
    </target>
  
    <target name="init">
      <tstamp />
    </target>
  
    <target name="build" description="Compile Chainsaw."
            depends="init, build.chainsaw"/>
  
    <target name="build.chainsaw" depends="init,vfs">
      <mkdir dir="${javac.dest}" />  	
      <javac deprecation="${deprecation}"
             srcdir="${java.source.dir}"
      	   debug="${debug}"
             destdir="${javac.dest}">
    		   <patternset>
    		   	<include name="${stem}/chainsaw/**/*.java"/>
      	    <exclude name="${stem}/chainsaw/vfs/**/*.java" unless="vfs-present"/>
    	       </patternset>
        <classpath refid="compile.classpath"/>   
      </javac>
    </target>
  
    <!-- ================================================================= -->
    <!-- Remove all generated (compiled) class files.                      -->
    <!-- ================================================================= -->
    <target name="clean" depends="init" description="Delete compiled Chainsaw files">
      <delete dir="${javac.dest}/" />
    </target>
  
    <target name="log4jCheck">
      <available filepath="${base}" file="${log4j.jar}" property="log4j-present"/>
    	
      <fail unless="log4j-present">  	
  Log4j jar required here: ${jar.dest}/${log4j.jar}.    	
      </fail>
    </target>
  
  	  <target name="vfsCheck">
  	    <available classname="org.apache.commons.vfs.FileObject" property="vfs-present">
  	      <classpath refid="compile.classpath"/>
  	    </available>
  	  </target>
  	
  	  <target name="vfs" depends="vfsCheck" unless="vfs-present">
  	    <echo>
  	      Could not find vfs classes (http://jakarta.apache.org/commons/sandbox/vfs/). 
  Did you forget to set "vfs.jar" property in 
  build.properties to point to a valid vfs jar file?  
  
  Chainsaw will be built but will not include support 
  for VFSLogFilePatternReceiver
  	    </echo>
  	  </target>	
    	
    <!-- ================================================================= -->
    <!-- Runs Chainsaw                                                     -->
    <!-- ================================================================= -->
  
    <target name="chainsaw" depends="chainsaw.jar, log4jCheck" description="Build and run Chainsaw v2 from jar file (generates Chainsaw jar if necessary)" >
  
      <!-- Need to fork to avoid problems -->
      <java classname="org.apache.log4j.chainsaw.LogUI" fork="yes"
            classpath="${jar.dest}/${log4j.jar};${jar.dest}/${log4j-chainsaw.jar};${jaxp.parser.jar};${regexp.oro.jar};${jms.jar}">
  	<sysproperty key="log4j.debug" value="${log4j.debug}"/> 
      </java>
    </target>
  
    <!-- ================================================================= -->
    <!-- Aactual work is done in the dependencies.                         -->
    <!-- ================================================================= -->
    <target name="jar" depends="chainsaw.jar" description="Create chainsaw jar">
    </target>
  
    <!-- ================================================================= -->
    <!-- Create log4j-chainsaw.jar, excluding everything else              -->
    <!-- ================================================================= -->
    <target name="chainsaw.jar" depends="build">
      <delete>
        <fileset dir="${jar.dest}">
          <include name="${log4j-chainsaw.jar}"/>
        </fileset>
      </delete>
  
      <copy todir="${javac.dest}">
        <fileset dir="src/java" includes="**/chainsaw/**/*"/>
      </copy>
  
      <!-- JavaDoc up some Receiver and other stuff we want to be able to ship with Chainsaw-->
      <javadoc sourcepath="${java.source.dir}"
        destdir="${javac.dest}"
       version="true"
       author="true"
       use="true"
       overview="${jar.dest}/overview.html"
       doctitle="log4j version ${version}&lt;br&gt;API Specification"
       windowtitle="Log4j Version ${version}"
             header="&lt;b&gt;Log4j ${version}&lt;/b&gt;"
       bottom="Copyright 2000-2003 Apache Software Foundation."
          >
  	    <fileset dir="src/java" defaultexcludes="yes">
  	      <include name="**/*Receiver.java" />
  	    </fileset>
          <classpath refid="compile.classpath"/>
          
      </javadoc>        
        
        
      <jar jarfile="${jar.dest}/${log4j-chainsaw.jar}" basedir="${javac.dest}"
           includes="${stem}/chainsaw/*.class,
                  ${stem}/**/*.html,
                  **/*.css,
                  **/resources/*,
                  ${stem}/**/*BeanInfo.class,
           		${stem}/chainsaw/**/*.class, 
            		${stem}/chainsaw/layout/*, 
           		${stem}/chainsaw/icons/*.gif, 
           		${stem}/chainsaw/*.jpg, 
           		${stem}/chainsaw/**/*.xml, 
           		${stem}/chainsaw/**/*.html, 
           		${stem}/chainsaw/**/*.properties, 
           		${stem}/chainsaw/receivers/known.receivers, 
           		${stem}/chainsaw/icons/*.jpg, 
           		${stem}/chainsaw/icons/LICENCE"
           excludes="**/UnitTest**">
      	<!-- we need to exclude the JMS + DB Receiver BeanInfo for webstart purposes -->
      	<exclude name="**/JMS*BeanInfo.class" if="webstart" />
      	<exclude name="**/DB*BeanInfo.class" if="webstart" />
        <manifest>
          <attribute name="Manifest-version" value="1.0"/>
          <section name="org/apache/log4j/">
            <attribute name="Implementation-Title" value="log4j"/>
            <attribute name="Implementation-Version" value="${version}"/>
            <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
          </section>
          <attribute name="Main-Class" value="org.apache.log4j.chainsaw.LogUI"/>
          <attribute name="Class-Path" value="${log4j.jar}"/>
        </manifest>
      </jar>
    </target>
  
    <!-- ================================================================= -->
    <!-- These targets are for when we need to create a Java Web start distribution of Chainsaw -->
    <!-- ================================================================= -->
  
    <target name="webstart-dependant-receivers.jar" depends="build">
      <delete>
        <fileset dir="${jar.dest}">
          <include name="${webstart-dependant-receivers.jar}"/>
        </fileset>
      </delete>
  
      <jar jarfile="${jar.dest}/${webstart-dependant-receivers.jar}" basedir="${javac.dest}"
        includes="${stem}/**/JMSReceiver*.class, ${stem}/**/DBReceiver*.class">
        <manifest>
          <attribute name="Manifest-version" value="1.0"/>
          <section name="org/apache/log4j/">
            <attribute name="Implementation-Title" value="log4j"/>
            <attribute name="Implementation-Version" value="${version}"/>
            <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
          </section>
        </manifest>
      </jar>
    </target>
  
  	<target name="webstart" >
    	<property name="webstart" value="true"/>
    	 <antcall target="jar"/>
   	 <antcall target="webstart-dependant-receivers.jar"/>
  		
  		  <input
  		    message="Please enter key password:"
  		    addproperty="keypass"
  		  />
  		<signjar verbose="false" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" >
  		 <fileset dir=".">
  		  <include name="*.jar"/>
  		 </fileset>
  		</signjar>
  		
  		<zip destfile="chainsaw-bundle.zip" >
  			<zipfileset dir="."> 
  				<include name="*.jar"/>
  			</zipfileset>
  			<fileset file="${regexp.oro.jar}"/>
  			<fileset file="src/chainsaw.bat"/>
  		</zip>
    </target>
  	
    <!-- ================================================================= -->
    <!-- This target builds the javadoc files.                             -->
    <!-- ================================================================= -->
    <target name="javadoc" depends="init" description="Generate Chainsaw-related Javadoc">
  
      <mkdir dir="${javadoc.dest}" />
  
      <javadoc sourcepath="${java.source.dir}"
        destdir="${javadoc.dest}"
       packagenames="org.apache.log4j,
         org.apache.log4j.chainsaw,
         org.apache.log4j.chainsaw.color,
         org.apache.log4j.chainsaw.favourites,
         org.apache.log4j.chainsaw.filter,
         org.apache.log4j.chainsaw.help,
         org.apache.log4j.chainsaw.helper,
         org.apache.log4j.chainsaw.dnd,
         org.apache.log4j.chainsaw.icons,
         org.apache.log4j.chainsaw.layout,
         org.apache.log4j.chainsaw.messages,
         org.apache.log4j.chainsaw.plugins,
         org.apache.log4j.chainsaw.prefs,
         org.apache.log4j.chainsaw.receivers,
         org.apache.log4j.chainsaw.vfs"
       additionalparam="-breakiterator"
       version="true"
       protected="true"
       author="true"
       use="true"
       overview="${docs.dest}/overview.html"
       doctitle="log4j version ${version}&lt;br&gt;API Specification"
       windowtitle="Log4j Version ${version}"
             header="&lt;b&gt;Log4j ${version}&lt;/b&gt;"
       bottom="Copyright 2000-2003 Apache Software Foundation.">
  
        <link href="http://java.sun.com/products/j2se/1.3/docs/api/"/>
        <link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
        <classpath refid="compile.classpath"/>
        <classpath path="${regexp.oro.jar}"/>
      </javadoc>
    </target>
  
  </project>
  
  
  
  

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


Mime
View raw message