de.unkrig.commons.util.logging.filter
Class ByExpressionFilter

java.lang.Object
  extended by de.unkrig.commons.util.logging.filter.ByExpressionFilter
All Implemented Interfaces:
java.util.logging.Filter

public class ByExpressionFilter
extends java.lang.Object
implements java.util.logging.Filter

A Filter that filters LogRecords by an ".condition" property like

   method == "foo" && message =~ ".*bla.*"
 
The following variables are supported:
NameContents
nameThe logger's name
messageThe log message (before parameter substitution)
classThe fully qualified name of the logged class
methodThe name of the logged method
levelThe log level name
parameter0,
parameter1,
...
Parameter #0, #1, ...

See Also:
ExpressionEvaluator

Constructor Summary
ByExpressionFilter()
          Zero-args constructor for the log manager.
ByExpressionFilter(Expression condition)
           
ByExpressionFilter(java.lang.String propertyNamePrefix)
          One-arg constructor for proxies
 
Method Summary
 boolean isLoggable(java.util.logging.LogRecord record)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByExpressionFilter

public ByExpressionFilter()
                   throws ParseException
Zero-args constructor for the log manager.

Throws:
ParseException

ByExpressionFilter

public ByExpressionFilter(java.lang.String propertyNamePrefix)
                   throws ParseException
One-arg constructor for proxies

Throws:
ParseException

ByExpressionFilter

public ByExpressionFilter(Expression condition)
See Also:
ByExpressionFilter
Method Detail

isLoggable

public boolean isLoggable(java.util.logging.LogRecord record)
Specified by:
isLoggable in interface java.util.logging.Filter