Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.logging.log4j.core.appender.rewrite
Class PropertiesRewritePolicy

    java.lang.Object
      org.apache.logging.log4j.core.appender.rewrite.PropertiesRewritePolicy

All Implemented Interfaces:
  RewritePolicy

    @Plugin(name="PropertiesRewritePolicy",
            category="Core",
            elementType="rewritePolicy",
            printObject=true)
    public final class PropertiesRewritePolicy

extends Object
implements RewritePolicy

This policy modifies events by replacing or possibly adding keys and values to the MapMessage.

Field Summary
`protected static org.apache.logging.log4j.Logger` | `LOGGER` Allow subclasses access to the status logger without creating another instance.

Method Summary
`static PropertiesRewritePolicy` | `createPolicy(Configuration config, Property[] props)` The factory method to create the PropertiesRewritePolicy.
`LogEvent` | `rewrite(LogEvent source)` Rewrite the event.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### LOGGER

    protected static final org.apache.logging.log4j.Logger LOGGER

  Allow subclasses access to the status logger without creating another instance.

Method Detail

### rewrite

    public LogEvent rewrite(LogEvent source)

  Rewrite the 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:
    The LogEvent after rewriting.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### createPolicy

    @PluginFactory
    public static PropertiesRewritePolicy createPolicy(@PluginConfiguration
                                                                     Configuration config,
                                                                     @PluginElement(value="Properties")
                                                                     Property[] props)

  The factory method to create the PropertiesRewritePolicy.

  Parameters:
    `config` - The Configuration.
    `props` - key/value pairs for the new keys and values.
  Returns:
    The PropertiesRewritePolicy.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.