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
Method Summary |
int |
decide(LoggingEvent event)
NOTE: This filter modifies logging events by adding
properties to the event. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionFilter
public ReflectionFilter()
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.
- Overrides:
decide
in class Filter
- Since:
- 1.3
Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.