Log4j 1.3alpha-5

org.apache.log4j.filter
Class ReflectionFilter

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.spi.Filter
              |
              +--org.apache.log4j.filter.ReflectionFilter
All Implemented Interfaces:
Component, OptionHandler

public class ReflectionFilter
extends Filter


Field Summary
 
Fields inherited from class org.apache.log4j.spi.Filter
ACCEPT, DENY, NEUTRAL
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
ReflectionFilter()
           
 
Method Summary
 int decide(LoggingEvent event)
          NOTE: This filter modifies logging events by adding properties to the event.
 
Methods inherited from class org.apache.log4j.spi.Filter
activateOptions, getNext, setNext
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, setLoggerRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionFilter

public ReflectionFilter()
Method Detail

decide

public int decide(LoggingEvent event)
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.

Specified by:
decide in class Filter
Parameters:
event - The LoggingEvent to decide upon.
Since:
1.3

Log4j 1.3alpha-5

Copyright 2000-2005 Apache Software Foundation.