public abstract class AbstractTarget extends Object implements Target
| Modifier and Type | Field and Description |
|---|---|
protected List |
filters |
protected String |
id |
protected short |
level |
protected int |
loggerCount |
| Constructor and Description |
|---|
AbstractTarget()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(String value)
Adds a filter to this target.
|
void |
addLogger(Logger logger)
Sets up this target with the specified logger.
|
boolean |
containsFilter(String filter) |
List |
getFilters()
Return a read-only snap-shot of the current filters for this target.
|
String |
getId()
Return the target's unique ID.
|
short |
getLevel()
Return the log level for this target.
|
void |
initialize(String id,
ConfigMap properties)
Initializes the target with id and properties.
|
void |
removeFilter(String value)
Removes a filter from this target.
|
void |
removeLogger(Logger logger)
Stops this target from receiving events from the specified logger.
|
void |
setFilters(List value)
Sets the list of filters for this target.
|
void |
setLevel(short value)
Sets the log level for this target.
|
protected final String id
protected List filters
protected volatile short level
protected volatile int loggerCount
public void initialize(String id, ConfigMap properties)
initialize in interface Targetid - id for the target which is ignored.properties - ConfigMap of properties for the target.public List getFilters()
getFilters in interface Targetpublic void addFilter(String value)
public void removeFilter(String value)
removeFilter in interface Targetvalue - Filter to be removed.public void setFilters(List value)
setFilters in interface Targetvalue - List of filters.public short getLevel()
public String getId()
public void setLevel(short value)
LogEvent.ERROR.public void addLogger(Logger logger)
public void removeLogger(Logger logger)
removeLogger in interface Targetlogger - this target should ignore.public boolean containsFilter(String filter)
filter - category to check against the filters defined for this targetCopyright © 2015 The Apache Software Foundation. All rights reserved.