public class Interpolator extends AbstractConfigurationAwareLookup implements LoggerContextAware
StrLookup
s.Modifier and Type | Field and Description |
---|---|
protected WeakReference<LoggerContext> |
loggerContext |
static char |
PREFIX_SEPARATOR
Constant for the prefix separator.
|
configuration
Constructor and Description |
---|
Interpolator()
Create the default Interpolator.
|
Interpolator(Map<String,String> properties)
Creates the default Interpolator with the provided properties.
|
Interpolator(StrLookup defaultLookup) |
Interpolator(StrLookup defaultLookup,
List<String> pluginPackages)
Constructs an Interpolator using a given StrLookup and a list of packages to find Lookup plugins in.
|
Modifier and Type | Method and Description |
---|---|
LookupResult |
evaluate(LogEvent event,
String var)
Resolves the specified variable.
|
StrLookup |
getDefaultLookup() |
Map<String,StrLookup> |
getStrLookupMap() |
String |
lookup(LogEvent event,
String var)
Resolves the specified variable.
|
void |
setLoggerContext(LoggerContext loggerContext)
Injects the current LoggerContext into this object.
|
String |
toString() |
setConfiguration
evaluate, lookup
public static final char PREFIX_SEPARATOR
protected WeakReference<LoggerContext> loggerContext
public Interpolator(StrLookup defaultLookup)
public Interpolator(StrLookup defaultLookup, List<String> pluginPackages)
defaultLookup
- the default StrLookup to use as a fallbackpluginPackages
- a list of packages to scan for Lookup pluginspublic Interpolator()
public StrLookup getDefaultLookup()
public String lookup(LogEvent event, String var)
public LookupResult evaluate(LogEvent event, String var)
public void setLoggerContext(LoggerContext loggerContext)
LoggerContextAware
setLoggerContext
in interface LoggerContextAware
loggerContext
- the current LoggerContext Copyright © 1999-2023 The 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.