Added: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-frame.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-frame.html?rev=569257&view=auto ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-frame.html (added) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-frame.html Thu Aug 23 22:43:39 2007 @@ -0,0 +1,24 @@ + + + + + + Apache Extras Companion for log4j 1.2. 1.0 Reference Package org.apache.log4j.extras + + + + +

+ org.apache.log4j.extras +

+ +

Classes

+ + + + + \ No newline at end of file Propchange: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-frame.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-summary.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-summary.html?rev=569257&view=auto ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-summary.html (added) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-summary.html Thu Aug 23 22:43:39 2007 @@ -0,0 +1,67 @@ + + + + + + Apache Extras Companion for log4j 1.2. 1.0 Reference Package $name + + + +
+ +
+
+ +
+ +

Package org.apache.log4j.extras

+ + + + + + + + + + + + +
Class Summary
+ DOMConfigurator +
+ +
+ +
+
+ +
+
+ Copyright © null Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Propchange: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/extras/package-summary.html ------------------------------------------------------------------------------ svn:mime-type = text/html Modified: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/AndFilter.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/AndFilter.html?rev=569257&r1=569256&r2=569257&view=diff ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/AndFilter.html (original) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/AndFilter.html Thu Aug 23 22:43:39 2007 @@ -30,122 +30,123 @@ 21 import org.apache.log4j.spi.LoggingEvent; 22 import org.apache.log4j.spi.OptionHandler; 23 import org.apache.log4j.xml.UnrecognizedElementHandler; -24 import org.apache.log4j.rolling.RollingConfigurator; -25 import org.w3c.dom.Element; -26 -27 import java.util.Properties; +24 import org.w3c.dom.Element; +25 +26 import java.util.Properties; +27 28 -29 -30 /*** -31 * A filter that 'and's the results of any number of contained filters together. -32 * -33 * For the filter to process events, all contained filters must return Filter.ACCEPT. -34 * -35 * If the contained filters do not return Filter.ACCEPT, Filter.NEUTRAL is returned. -36 * -37 * If acceptOnMatch is set to true, Filter.ACCEPT is returned. -38 * If acceptOnMatch is set to false, Filter.DENY is returned. -39 * -40 * Here is an example config that will accept only events that contain BOTH -41 * a DEBUG level AND 'test' in the message: -42 * -43 *<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender"> -44 * <filter class="org.apache.log4j.filter.AndFilter"> -45 * <filter class="org.apache.log4j.filter.LevelMatchFilter"> -46 * <param name="levelToMatch" value="DEBUG" /> -47 * <param name="acceptOnMatch" value="true" /> -48 * </filter> -49 * <filter class="org.apache.log4j.filter.StringMatchFilter"> -50 * <param name="stringToMatch" value="test" /> -51 * <param name="acceptOnMatch" value="true" /> -52 * </filter> -53 * <param name="acceptOnMatch" value="false"/> -54 * </filter> -55 * <filter class="org.apache.log4j.filter.DenyAllFilter"/> -56 *<layout class="org.apache.log4j.SimpleLayout"/> -57 *</appender> -58 * -59 * To accept all events EXCEPT those events that contain a -60 * DEBUG level and 'test' in the message: -61 * change the AndFilter's acceptOnMatch param to false and remove the DenyAllFilter -62 * -63 * NOTE: If you are defining a filter that is only relying on logging event content -64 * (no external or filter-managed state), you could opt instead -65 * to use an ExpressionFilter with one of the following expressions: -66 * -67 * LEVEL == DEBUG && MSG ~= 'test' -68 * or -69 * ! ( LEVEL == DEBUG && MSG ~= 'test' ) -70 * -71 * XML configuration of this filter requires use of either log4j 1.2.15 or later or -72 * org.apache.log4j.rolling.RollingConfigurator. -73 * -74 * @author Scott Deboy sdeboy@apache.org -75 */ -76 public class AndFilter extends Filter implements UnrecognizedElementHandler { -77 Filter headFilter = null; -78 Filter tailFilter = null; -79 boolean acceptOnMatch = true; -80 -81 public void activateOptions() { -82 } -83 -84 public void addFilter(final Filter filter) { -85 System.out.println("add"+filter); -86 if (headFilter == null) { -87 headFilter = filter; -88 tailFilter = filter; -89 } else { -90 tailFilter.next = filter; -91 } -92 } -93 -94 public void setAcceptOnMatch(final boolean acceptOnMatch) { -95 this.acceptOnMatch = acceptOnMatch; -96 } -97 /*** -98 * If this event does not already contain location information, -99 * evaluate the event against the expression. -100 * -101 * If the expression evaluates to true, generate a LocationInfo instance -102 * by creating an exception and set this LocationInfo on the event. -103 * -104 * Returns {@link Filter#NEUTRAL} -105 */ -106 public int decide(final LoggingEvent event) { -107 boolean accepted = true; -108 Filter f = headFilter; -109 while (f != null) { -110 accepted = accepted && (Filter.ACCEPT == f.decide(event)); -111 f = f.next; -112 } -113 if (accepted) { -114 if(acceptOnMatch) { -115 return Filter.ACCEPT; -116 } -117 return Filter.DENY; -118 } -119 return Filter.NEUTRAL; -120 } -121 -122 /*** -123 * {@inheritDoc} -124 */ -125 public boolean parseUnrecognizedElement(final Element element, -126 final Properties props) throws Exception { -127 final String nodeName = element.getNodeName(); -128 if ("filter".equals(nodeName)) { -129 OptionHandler filter = RollingConfigurator.parseElement(element, props, Filter.class); -130 if (filter instanceof Filter) { -131 filter.activateOptions(); -132 this.addFilter((Filter) filter); -133 } -134 return true; -135 } -136 return false; -137 } -138 -139 } +29 /*** +30 * A filter that 'and's the results of any number of contained filters together. +31 * +32 * For the filter to process events, all contained filters must return Filter.ACCEPT. +33 * +34 * If the contained filters do not return Filter.ACCEPT, Filter.NEUTRAL is returned. +35 * +36 * If acceptOnMatch is set to true, Filter.ACCEPT is returned. +37 * If acceptOnMatch is set to false, Filter.DENY is returned. +38 * +39 * Here is an example config that will accept only events that contain BOTH +40 * a DEBUG level AND 'test' in the message: +41 * +42 *<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender"> +43 * <filter class="org.apache.log4j.filter.AndFilter"> +44 * <filter class="org.apache.log4j.filter.LevelMatchFilter"> +45 * <param name="levelToMatch" value="DEBUG" /> +46 * <param name="acceptOnMatch" value="true" /> +47 * </filter> +48 * <filter class="org.apache.log4j.filter.StringMatchFilter"> +49 * <param name="stringToMatch" value="test" /> +50 * <param name="acceptOnMatch" value="true" /> +51 * </filter> +52 * <param name="acceptOnMatch" value="false"/> +53 * </filter> +54 * <filter class="org.apache.log4j.filter.DenyAllFilter"/> +55 *<layout class="org.apache.log4j.SimpleLayout"/> +56 *</appender> +57 * +58 * To accept all events EXCEPT those events that contain a +59 * DEBUG level and 'test' in the message: +60 * change the AndFilter's acceptOnMatch param to false and remove the DenyAllFilter +61 * +62 * NOTE: If you are defining a filter that is only relying on logging event content +63 * (no external or filter-managed state), you could opt instead +64 * to use an ExpressionFilter with one of the following expressions: +65 * +66 * LEVEL == DEBUG && MSG ~= 'test' +67 * or +68 * ! ( LEVEL == DEBUG && MSG ~= 'test' ) +69 * +70 * XML configuration of this filter requires use of either log4j 1.2.15 or later or +71 * org.apache.log4j.rolling.DOMConfigurator. +72 * +73 * @author Scott Deboy sdeboy@apache.org +74 */ +75 public class AndFilter extends Filter implements UnrecognizedElementHandler { +76 Filter headFilter = null; +77 Filter tailFilter = null; +78 boolean acceptOnMatch = true; +79 +80 public void activateOptions() { +81 } +82 +83 public void addFilter(final Filter filter) { +84 System.out.println("add"+filter); +85 if (headFilter == null) { +86 headFilter = filter; +87 tailFilter = filter; +88 } else { +89 tailFilter.next = filter; +90 } +91 } +92 +93 public void setAcceptOnMatch(final boolean acceptOnMatch) { +94 this.acceptOnMatch = acceptOnMatch; +95 } +96 /*** +97 * If this event does not already contain location information, +98 * evaluate the event against the expression. +99 * +100 * If the expression evaluates to true, generate a LocationInfo instance +101 * by creating an exception and set this LocationInfo on the event. +102 * +103 * Returns {@link Filter#NEUTRAL} +104 */ +105 public int decide(final LoggingEvent event) { +106 boolean accepted = true; +107 Filter f = headFilter; +108 while (f != null) { +109 accepted = accepted && (Filter.ACCEPT == f.decide(event)); +110 f = f.next; +111 } +112 if (accepted) { +113 if(acceptOnMatch) { +114 return Filter.ACCEPT; +115 } +116 return Filter.DENY; +117 } +118 return Filter.NEUTRAL; +119 } +120 +121 /*** +122 * {@inheritDoc} +123 */ +124 public boolean parseUnrecognizedElement(final Element element, +125 final Properties props) throws Exception { +126 final String nodeName = element.getNodeName(); +127 if ("filter".equals(nodeName)) { +128 OptionHandler filter = +129 org.apache.log4j.extras.DOMConfigurator.parseElement( +130 element, props, Filter.class); +131 if (filter instanceof Filter) { +132 filter.activateOptions(); +133 this.addFilter((Filter) filter); +134 } +135 return true; +136 } +137 return false; +138 } +139 +140 }
Modified: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/ExpressionFilter.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/ExpressionFilter.html?rev=569257&r1=569256&r2=569257&view=diff ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/ExpressionFilter.html (original) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/ExpressionFilter.html Thu Aug 23 22:43:39 2007 @@ -58,7 +58,7 @@ 49 * infomsg-45 or infomsg-44 in the message, 50 * as well as all messages with a level of WARN or higher, 51 * build an expression using -52 * the LikeRule (supports ORO-based regular expressions) and the InequalityRule. +52 * the LikeRule (supports java.util.regex based regular expressions) and the InequalityRule. 53 * <b> ( MSG LIKE infomsg-4[4,5] ) && ( LEVEL >= WARN ) </b> 54 * <p/> 55 * Three options are required: Modified: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/LoggerMatchFilter.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/LoggerMatchFilter.html?rev=569257&r1=569256&r2=569257&view=diff ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/LoggerMatchFilter.html (original) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/LoggerMatchFilter.html Thu Aug 23 22:43:39 2007 @@ -43,7 +43,7 @@ 34 org.apache.log4j.spi.Filter#NEUTRAL} is returned. A loggerToMatch of "root" 35 matches both the root logger and a logger named "root". 36 -37 @since 1.3 */ +37 */ 38 public class LoggerMatchFilter extends Filter { 39 /*** 40 Do we return ACCEPT when a match occurs. Default is Added: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/TimeFilter.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/TimeFilter.html?rev=569257&view=auto ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/TimeFilter.html (added) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/TimeFilter.html Thu Aug 23 22:43:39 2007 @@ -0,0 +1,166 @@ + + + +TimeFilter xref + + + +
View Javadoc
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  
+18  package org.apache.log4j.filter;
+19  
+20  import org.apache.log4j.helpers.LogLog;
+21  import org.apache.log4j.spi.Filter;
+22  import org.apache.log4j.spi.LoggingEvent;
+23  
+24  import java.text.ParseException;
+25  import java.text.SimpleDateFormat;
+26  import java.util.Calendar;
+27  import java.util.TimeZone;
+28  
+29  /***
+30   * Filters events that fall within a specified time period
+31   * in each day.
+32   *
+33  */
+34  public final class TimeFilter extends Filter {
+35  
+36    private boolean acceptOnMatch;
+37      /***
+38       * Starting offset from midnight in milliseconds.
+39       */
+40    private long start;
+41      /***
+42       * Ending offset from midnight in milliseconds.
+43       */
+44    private long end;
+45      /***
+46       * Timezone.
+47       */
+48    private Calendar calendar;
+49  
+50  
+51      /***
+52       * Length of hour in milliseconds.
+53       */
+54    private static final long HOUR_MS = 3600000;
+55  
+56      /***
+57       * Length of minute in milliseconds.
+58       */
+59    private static final long MINUTE_MS = 60000;
+60  
+61      /***
+62       * Length of second in milliseconds.
+63       */
+64    private static final long SECOND_MS = 1000;
+65  
+66      /***
+67       * Constructor.
+68       */
+69    public TimeFilter() {
+70        acceptOnMatch = true;
+71        start = 0;
+72        end = Long.MAX_VALUE;
+73        calendar = Calendar.getInstance();
+74    }
+75  
+76      /***
+77       * Set start (inclusive) of time span.
+78       * @param s string representation of start time as HH:mm:ss.
+79       */
+80    public void setStart(final String s) {
+81        SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
+82        stf.setTimeZone(TimeZone.getTimeZone("UTC"));
+83        try {
+84           start = stf.parse(s).getTime();
+85        } catch(ParseException ex) {
+86            LogLog.warn("Error parsing start value " + s, ex);
+87        }
+88    }
+89  
+90      /***
+91       * Set end (exclusive) of time span.
+92       * @param s string representation of end time as HH:mm:ss.
+93       */
+94    public void setEnd(final String s) {
+95          SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
+96          stf.setTimeZone(TimeZone.getTimeZone("UTC"));
+97          try {
+98              end = stf.parse(s).getTime();
+99          } catch(ParseException ex) {
+100             LogLog.warn("Error parsing end value " + s, ex);
+101         }
+102     }
+103 
+104     /***
+105      * Set timezone.
+106      * @param s time zone.
+107      */
+108   public void setTimeZone(final String s) {
+109       if (s == null) {
+110           calendar = Calendar.getInstance();
+111       } else {
+112         calendar = Calendar.getInstance(TimeZone.getTimeZone(s));
+113       }
+114   }
+115 
+116     /***
+117      * Sets whether an event within the timespan should be accepted or denied.
+118      * @param acceptOnMatch true if matching event should be accepted.
+119      */
+120   public synchronized void setAcceptOnMatch(boolean acceptOnMatch) {
+121     this.acceptOnMatch = acceptOnMatch;
+122   }
+123 
+124     /***
+125      * Gets whether an event within the timespan should be accepted or denied.
+126      * @return true if matching event should be accepted.
+127      */
+128   public synchronized boolean getAcceptOnMatch() {
+129     return acceptOnMatch;
+130   }
+131 
+132   /*** {@inheritDoc} */
+133   public int decide(final LoggingEvent event) {
+134     calendar.setTimeInMillis(event.timeStamp);
+135     //
+136     //   get apparent number of milliseconds since midnight
+137     //      (ignores extra or missing hour on daylight time changes).
+138     //
+139     long apparentOffset = calendar.get(Calendar.HOUR_OF_DAY) * HOUR_MS +
+140         calendar.get(Calendar.MINUTE) * MINUTE_MS +
+141         calendar.get(Calendar.SECOND) * SECOND_MS +
+142         calendar.get(Calendar.MILLISECOND);
+143     if (apparentOffset >= start && apparentOffset < end) {
+144         if (acceptOnMatch) {
+145             return Filter.ACCEPT;
+146         } else {
+147             return Filter.DENY;
+148         }
+149     }
+150     return Filter.NEUTRAL;
+151   }
+152 }
+153 
+
+
+ + Propchange: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/TimeFilter.html ------------------------------------------------------------------------------ svn:mime-type = text/html Modified: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-frame.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-frame.html?rev=569257&r1=569256&r2=569257&view=diff ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-frame.html (original) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-frame.html Thu Aug 23 22:43:39 2007 @@ -3,7 +3,7 @@ - Apache Extras Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package org.apache.log4j.filter + Apache Extras Companion for log4j 1.2. 1.0 Reference Package org.apache.log4j.filter @@ -38,6 +38,9 @@
  • StringMatchFilter +
  • +
  • + TimeFilter
  • Modified: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-summary.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-summary.html?rev=569257&r1=569256&r2=569257&view=diff ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-summary.html (original) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/filter/package-summary.html Thu Aug 23 22:43:39 2007 @@ -3,7 +3,7 @@ - Apache Extras Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package $name + Apache Extras Companion for log4j 1.2. 1.0 Reference Package $name @@ -73,6 +73,11 @@ StringMatchFilter + + + + + TimeFilter Added: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/MDCKeySetExtractor.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/MDCKeySetExtractor.html?rev=569257&view=auto ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/MDCKeySetExtractor.html (added) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/MDCKeySetExtractor.html Thu Aug 23 22:43:39 2007 @@ -0,0 +1,106 @@ + + + +MDCKeySetExtractor xref + + + +
    View Javadoc
    +
    +1   /*
    +2    * Licensed to the Apache Software Foundation (ASF) under one or more
    +3    * contributor license agreements.  See the NOTICE file distributed with
    +4    * this work for additional information regarding copyright ownership.
    +5    * The ASF licenses this file to You under the Apache License, Version 2.0
    +6    * (the "License"); you may not use this file except in compliance with
    +7    * the License.  You may obtain a copy of the License at
    +8    *
    +9    *      http://www.apache.org/licenses/LICENSE-2.0
    +10   *
    +11   * Unless required by applicable law or agreed to in writing, software
    +12   * distributed under the License is distributed on an "AS IS" BASIS,
    +13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +14   * See the License for the specific language governing permissions and
    +15   * limitations under the License.
    +16   */
    +17  package org.apache.log4j.helpers;
    +18  
    +19  import org.apache.log4j.spi.LoggingEvent;
    +20  import org.apache.log4j.pattern.LogEvent;
    +21  
    +22  import java.lang.reflect.Method;
    +23  import java.lang.reflect.InvocationTargetException;
    +24  import java.util.Set;
    +25  import java.io.ByteArrayOutputStream;
    +26  import java.io.ObjectOutputStream;
    +27  import java.io.ByteArrayInputStream;
    +28  import java.io.ObjectInputStream;
    +29  
    +30  
    +31  public final class MDCKeySetExtractor {
    +32      private final Method getKeySetMethod;
    +33      public static final MDCKeySetExtractor INSTANCE =
    +34              new MDCKeySetExtractor();
    +35  
    +36  
    +37      private MDCKeySetExtractor() {
    +38          //
    +39          //  log4j 1.2.15 and later will have method to get names
    +40          //     of all keys in MDC
    +41          //
    +42        Method getMethod = null;
    +43  
    +44          try {
    +45             getMethod = LoggingEvent.class.getMethod(
    +46                        "getPropertyKeySet", null);
    +47          } catch(Exception ex) {
    +48              getMethod = null;
    +49          }
    +50        getKeySetMethod = getMethod;
    +51  
    +52      }
    +53  
    +54      public Set getPropertyKeySet(final LoggingEvent event) throws Exception {
    +55          //
    +56          //  MDC keys are not visible prior to log4j 1.2.15
    +57          //
    +58          Set keySet = null;
    +59          if (getKeySetMethod != null) {
    +60                keySet = (Set) getKeySetMethod.invoke(event, null);
    +61          } else {
    +62              //
    +63              //  for 1.2.14 and earlier could serialize and
    +64              //    extract MDC content
    +65                ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
    +66                ObjectOutputStream os = new ObjectOutputStream(outBytes);
    +67                os.writeObject(event);
    +68                os.close();
    +69  
    +70                byte[] raw = outBytes.toByteArray();
    +71                //
    +72                //   bytes 6 and 7 should be the length of the original classname
    +73                //     should be the same as our substitute class name
    +74                final String subClassName = LogEvent.class.getName();
    +75                if (raw[6] == 0 || raw[7] == subClassName.length()) {
    +76                    //
    +77                    //  manipulate stream to use our class name
    +78                    //
    +79                    for (int i = 0; i < subClassName.length(); i++) {
    +80                        raw[8 + i] = (byte) subClassName.charAt(i);
    +81                    }
    +82                    ByteArrayInputStream inBytes = new ByteArrayInputStream(raw);
    +83                    ObjectInputStream is = new ObjectInputStream(inBytes);
    +84                    Object cracked = is.readObject();
    +85                    if (cracked instanceof LogEvent) {
    +86                        keySet = ((LogEvent) cracked).getPropertyKeySet();
    +87                    }
    +88                    is.close();
    +89                }
    +90          }
    +91          return keySet;        
    +92      }
    +93  }
    +
    +
    + + Propchange: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/MDCKeySetExtractor.html ------------------------------------------------------------------------------ svn:mime-type = text/html Modified: logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/package-frame.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/package-frame.html?rev=569257&r1=569256&r2=569257&view=diff ============================================================================== --- logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/package-frame.html (original) +++ logging/site/trunk/docs/log4j/companions/extras/xref/org/apache/log4j/helpers/package-frame.html Thu Aug 23 22:43:39 2007 @@ -3,7 +3,7 @@ - Apache Extras Companion for log4j 1.2. 1.0-SNAPSHOT Reference Package org.apache.log4j.helpers + Apache Extras Companion for log4j 1.2. 1.0 Reference Package org.apache.log4j.helpers @@ -16,7 +16,7 @@