- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.joran.spi.SimpleRuleStore
-
- All Implemented Interfaces:
RuleStore,ContextAware
public class SimpleRuleStore extends ContextAwareBase implements RuleStore
This class implements theRuleStoreinterface. It is the rule store implementation used by default in Joran.- Author:
- Ceki Gülcü
-
-
Field Summary
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description SimpleRuleStore(Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPathPathMapping(String originalName, String modifiedName)Rename path parts.voidaddRule(ElementSelector elementSelector, String actionClassName)Add a new rule, given by a pattern and an action class (String).voidaddRule(ElementSelector elementSelector, Supplier<Action> actionSupplier)Add a new rule, i.e. a pattern, action pair to the rule store.voidaddTransparentPathPart(String pathPart)Supplier<Action>matchActions(ElementPath elementPath)Return a list of actions matching a pattern.StringtoString()-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Constructor Detail
-
SimpleRuleStore
public SimpleRuleStore(Context context)
-
-
Method Detail
-
addTransparentPathPart
public void addTransparentPathPart(String pathPart)
- Specified by:
addTransparentPathPartin interfaceRuleStore
-
addPathPathMapping
public void addPathPathMapping(String originalName, String modifiedName)
Rename path parts.- Specified by:
addPathPathMappingin interfaceRuleStore- Parameters:
originalName- the name before renamingmodifiedName- the after renaming- Since:
- 1.5.5
-
addRule
public void addRule(ElementSelector elementSelector, Supplier<Action> actionSupplier)
Add a new rule, i.e. a pattern, action pair to the rule store.Note that the added action's LoggerRepository will be set in the process.
-
addRule
public void addRule(ElementSelector elementSelector, String actionClassName)
Description copied from interface:RuleStoreAdd a new rule, given by a pattern and an action class (String).
-
matchActions
public Supplier<Action> matchActions(ElementPath elementPath)
Description copied from interface:RuleStoreReturn a list of actions matching a pattern.- Specified by:
matchActionsin interfaceRuleStore- Parameters:
elementPath- the path to match for- Returns:
- list of matching actions
-
-