@Plugin(name="LoggerNameLevelRewritePolicy", category="Core", elementType="rewritePolicy", printObject=true) public class LoggerNameLevelRewritePolicy extends Object implements RewritePolicy
Modifier and Type | Method and Description |
---|---|
static LoggerNameLevelRewritePolicy |
createPolicy(String loggerNamePrefix,
KeyValuePair[] levelPairs)
Creates a policy to rewrite levels for a given logger name.
|
LogEvent |
rewrite(LogEvent event)
Rewrite a logging event.
|
@PluginFactory public static LoggerNameLevelRewritePolicy createPolicy(@PluginAttribute(value="logger") String loggerNamePrefix, @PluginElement(value="KeyValuePair") KeyValuePair[] levelPairs)
loggerNamePrefix
- The logger name prefix for events to rewrite; all event logger names that start with this string will be
rewritten.levelPairs
- The levels to rewrite, the key is the source level, the value the target level.public LogEvent rewrite(LogEvent event)
RewritePolicy
rewrite
in interface RewritePolicy
event
- a logging event that may be returned or
used to create a new logging event.Copyright © 1999-2017. 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.