Package org.apache.log4j.rewrite
Class PropertyRewritePolicy
- java.lang.Object
-
- org.apache.log4j.rewrite.PropertyRewritePolicy
-
- All Implemented Interfaces:
RewritePolicy
public class PropertyRewritePolicy extends Object implements RewritePolicy
This policy rewrites events by adding a user-specified list of properties to the event. Existing properties are not modified.The combination of the RewriteAppender and this policy performs the same actions as the PropertyFilter from log4j 1.3.
-
-
Constructor Summary
Constructors Constructor Description PropertyRewritePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.log4j.spi.LoggingEvent
rewrite(org.apache.log4j.spi.LoggingEvent source)
Rewrite a logging event.void
setProperties(String props)
Set a string representing the property name/value pairs.
-
-
-
Method Detail
-
setProperties
public void setProperties(String props)
Set a string representing the property name/value pairs.Form: propname1=propvalue1,propname2=propvalue2
- Parameters:
props
-
-
rewrite
public org.apache.log4j.spi.LoggingEvent rewrite(org.apache.log4j.spi.LoggingEvent source)
Rewrite a logging event.- Specified by:
rewrite
in interfaceRewritePolicy
- 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.
-
-