org.apache.log4j.receivers.rewrite

## Class ReflectionRewritePolicy

- java.lang.Object
- - org.apache.log4j.receivers.rewrite.ReflectionRewritePolicy

- All Implemented Interfaces:
    RewritePolicy

      public class ReflectionRewritePolicy
      extends Object
      implements RewritePolicy

  This policy rewrites events by evaluating any JavaBean properties on the message object and adding them to the event properties. If the message object has a message property, the value of that property will be used as the message for the rewritten event and will not be added to the event properties. Values from the JavaBean properties will replace any existing property with the same name. The combination of the RewriteAppender and this policy performs the same actions as the ReflectionFilter from log4j 1.3.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReflectionRewritePolicy()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.log4j.spi.LoggingEvent` | `rewrite(org.apache.log4j.spi.LoggingEvent source)` Rewrite a logging event.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReflectionRewritePolicy

          public ReflectionRewritePolicy()

  - ### Method Detail

    - #### rewrite

          public org.apache.log4j.spi.LoggingEvent rewrite(org.apache.log4j.spi.LoggingEvent source)

      Rewrite a logging event.
      Specified by:
        `rewrite` in interface `RewritePolicy`
      Parameters:
        `source` - a logging event that may be returned or used to create a new logging event.
      Returns:
        a logging event or null to suppress processing.

Copyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.