logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1222082 [2/2] - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers: ./ log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/flume/ log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/ log4j2-core/src...
Date Thu, 22 Dec 2011 07:43:57 GMT
Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
Thu Dec 22 07:43:55 2011
@@ -31,10 +31,10 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- *
+ * Compare against a log level that is associated with an MDC value.
  */
-@Plugin(name="DynamicThresholdFilter", type="Core", elementType="filter", printObject = true)
-public class DynamicThresholdFilter extends FilterBase {
+@Plugin(name = "DynamicThresholdFilter", type = "Core", elementType = "filter", printObject
= true)
+public final class DynamicThresholdFilter extends FilterBase {
     private Map<String, Level> levelMap = new HashMap<String, Level>();
     private Level defaultThreshold = Level.ERROR;
     private String key;
@@ -84,6 +84,7 @@ public class DynamicThresholdFilter exte
 
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("key=").append(key);
@@ -103,6 +104,15 @@ public class DynamicThresholdFilter exte
         return sb.toString();
     }
 
+    /**
+     * Create the DynamicThresholdFilter.
+     * @param key The name of the key to compare.
+     * @param pairs An array of value and Level pairs.
+     * @param level The default Level.
+     * @param match The action to perform if a match occurs.
+     * @param mismatch The action to perform if no match occurs.
+     * @return The DynamicThresholdFilter.
+     */
     @PluginFactory
     public static DynamicThresholdFilter createFilter(@PluginAttr("key") String key,
                                                       @PluginElement("pairs") ValueLevelPair[]
pairs,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/Filtering.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/Filtering.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/Filtering.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/Filtering.java
Thu Dec 22 07:43:55 2011
@@ -19,8 +19,6 @@ package org.apache.logging.log4j.core.fi
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
 
-import java.util.Iterator;
-
 /**
  * Interface implemented by Classes that allow filtering to occur.
  */

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
Thu Dec 22 07:43:55 2011
@@ -26,15 +26,14 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.helpers.KeyValuePair;
 import org.apache.logging.log4j.message.MapMessage;
 import org.apache.logging.log4j.message.Message;
-import org.apache.logging.log4j.message.StructuredDataMessage;
 
 import java.util.HashMap;
 import java.util.Map;
 
 /**
- *
+ * A Filter that operates on a Map.
  */
-@Plugin(name="MapFilter", type="Core", elementType="filter", printObject=true)
+@Plugin(name = "MapFilter", type = "Core", elementType = "filter", printObject = true)
 public class MapFilter extends FilterBase {
     private final Map<String, String> map;
 

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java
Thu Dec 22 07:43:55 2011
@@ -31,10 +31,8 @@ import org.apache.logging.log4j.message.
  * configured marker as a parent.
  *
  */
-@Plugin(name="MarkerFilter", type="Core", elementType="filter", printObject=true)
-public class MarkerFilter extends FilterBase {
-
-    private static final String LEVEL = "level";
+@Plugin(name = "MarkerFilter", type = "Core", elementType = "filter", printObject = true)
+public final class MarkerFilter extends FilterBase {
 
     private final Marker marker;
 
@@ -64,10 +62,18 @@ public class MarkerFilter extends Filter
         return marker != null && marker.isInstanceOf(this.marker) ? onMatch : onMismatch;
     }
 
+    @Override
     public String toString() {
         return marker.getName();
     }
 
+    /**
+     * Create the MarkerFilter.
+     * @param marker The Marker to match.
+     * @param match The action to take if a match occurs.
+     * @param mismatch The action to take if no match occurs.
+     * @return A MarkerFilter.
+     */
     @PluginFactory
     public static MarkerFilter createFilter(@PluginAttr("marker") String marker,
                                             @PluginAttr("onMatch") String match,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
Thu Dec 22 07:43:55 2011
@@ -36,8 +36,8 @@ import java.util.regex.Pattern;
  * (false). The default is false.
  *
  */
-@Plugin(name="RegexFilter", type="Core", elementType="filter", printObject = true)
-public class RegexFilter extends FilterBase {
+@Plugin(name = "RegexFilter", type = "Core", elementType = "filter", printObject = true)
+public final class RegexFilter extends FilterBase {
 
     private final Pattern pattern;
     private final boolean useRawMessage;
@@ -75,6 +75,7 @@ public class RegexFilter extends FilterB
         return m.matches() ? onMatch : onMismatch;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("useRaw=").append(useRawMessage);
@@ -82,6 +83,14 @@ public class RegexFilter extends FilterB
         return sb.toString();
     }
 
+    /**
+     * Create a Filter that matches a regular expression.
+     * @param regex The regular expression to match.
+     * @param useRawMsg If true, the raw message will be used, otherwise the formatted message
will be used.
+     * @param match The action to perform when a match occurs.
+     * @param mismatch The action to perform when a mismatch occurs.
+     * @return The RegexFilter.
+     */
     @PluginFactory
     public static RegexFilter createFilter(@PluginAttr("regex") String regex,
                                            @PluginAttr("useRawMsg") String useRawMsg,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
Thu Dec 22 07:43:55 2011
@@ -32,10 +32,10 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- *
+ * Filter based on data in a StructuredDataMessage.
  */
-@Plugin(name="StructuredDataFilter", type="Core", elementType="filter", printObject=true)
-public class StructuredDataFilter extends MapFilter {
+@Plugin(name = "StructuredDataFilter", type = "Core", elementType = "filter", printObject
= true)
+public final class StructuredDataFilter extends MapFilter {
 
     private StructuredDataFilter(Map<String, String> map, boolean oper, Result onMatch,
Result onMismatch) {
         super(map, oper, onMatch, onMismatch);
@@ -85,6 +85,7 @@ public class StructuredDataFilter extend
         return match ? onMatch : onMismatch;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("isAnd=").append(isAnd());
@@ -103,6 +104,14 @@ public class StructuredDataFilter extend
         return sb.toString();
     }
 
+    /**
+     * Create the StructuredDataFilter.
+     * @param pairs Key and value pairs.
+     * @param oper The operator to perform. If not "or" the operation will be an "and".
+     * @param match The action to perform on a match.
+     * @param mismatch The action to perform on a mismatch.
+     * @return The StructuredDataFilter.
+     */
     @PluginFactory
     public static StructuredDataFilter createFilter(@PluginAttr("pairs") KeyValuePair[] pairs,
                                                     @PluginAttr("operator") String oper,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
Thu Dec 22 07:43:55 2011
@@ -33,10 +33,8 @@ import org.apache.logging.log4j.message.
  *
  * The default Level is ERROR.
  */
-@Plugin(name="ThresholdFilter", type="Core", elementType="filter", printObject=true)
-public class ThresholdFilter extends FilterBase {
-
-    private static final String LEVEL = "level";
+@Plugin(name = "ThresholdFilter", type = "Core", elementType = "filter", printObject = true)
+public final class ThresholdFilter extends FilterBase {
 
     private final Level level;
 
@@ -66,10 +64,18 @@ public class ThresholdFilter extends Fil
         return level.isAtLeastAsSpecificAs(this.level) ? onMatch : onMismatch;
     }
 
+    @Override
     public String toString() {
         return level.toString();
     }
 
+    /**
+     * Create a ThresholdFilter.
+     * @param loggerLevel The log Level.
+     * @param match The action to take on a match.
+     * @param mismatch The action to take on a mismatch.
+     * @return The created ThresholdFilter.
+     */
     @PluginFactory
     public static ThresholdFilter createFilter(@PluginAttr("level") String loggerLevel,
                                                @PluginAttr("onMatch") String match,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
Thu Dec 22 07:43:55 2011
@@ -34,22 +34,8 @@ import java.util.TimeZone;
 /**
  * Filters events that fall within a specified time period in each day.
  */
-@Plugin(name="TimeFilter", type="Core", elementType="filter", printObject = true)
-public class TimeFilter extends FilterBase {
-    /**
-     * Starting offset from midnight in milliseconds.
-     */
-    private final long start;
-    /**
-     * Ending offset from midnight in milliseconds.
-     */
-    private final long end;
-    /**
-     * Timezone.
-     */
-    private final TimeZone timezone;
-
-
+@Plugin(name = "TimeFilter", type = "Core", elementType = "filter", printObject = true)
+public final class TimeFilter extends FilterBase {
     /**
      * Length of hour in milliseconds.
      */
@@ -65,6 +51,20 @@ public class TimeFilter extends FilterBa
      */
     private static final long SECOND_MS = 1000;
 
+    /**
+     * Starting offset from midnight in milliseconds.
+     */
+    private final long start;
+    /**
+     * Ending offset from midnight in milliseconds.
+     */
+    private final long end;
+    /**
+     * Timezone.
+     */
+    private final TimeZone timezone;
+
+
     private TimeFilter(long start, long end, TimeZone tz, Result onMatch, Result onMismatch)
{
         super(onMatch, onMismatch);
         this.start = start;
@@ -87,6 +87,7 @@ public class TimeFilter extends FilterBa
         return (apparentOffset >= start && apparentOffset < end) ? onMatch
: onMismatch;
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("start=").append(start);
@@ -95,6 +96,15 @@ public class TimeFilter extends FilterBa
         return sb.toString();
     }
 
+    /**
+     * Create a TimeFilter.
+     * @param start The start time.
+     * @param end The end time.
+     * @param tz timezone.
+     * @param match Action to perform if the time matches.
+     * @param mismatch Action to perform if the action does not match.
+     * @return A TimeFilter.
+     */
     @PluginFactory
     public static TimeFilter createFilter(@PluginAttr("start") String start,
                                           @PluginAttr("end") String end,

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ValueLevelPair.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ValueLevelPair.java?rev=1222082&r1=1222081&r2=1222082&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ValueLevelPair.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/filter/ValueLevelPair.java
Thu Dec 22 07:43:55 2011
@@ -22,9 +22,9 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 
 /**
- *
+ * A key and its value.
  */
-@Plugin(name="ValueLevelPair", type="Core")
+@Plugin(name = "ValueLevelPair", type = "Core")
 public class ValueLevelPair {
 
     private String key;
@@ -43,6 +43,12 @@ public class ValueLevelPair {
         return level;
     }
 
+    /**
+     * Create a Value/Level pair using the Log Levels
+     * @param key The key.
+     * @param value Its value.
+     * @return A ValueLevelPair.
+     */
     @PluginFactory
     public static ValueLevelPair createPair(@PluginAttr("key") String key,
                                           @PluginAttr("threshold")  String value) {



Mime
View raw message