|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.Filterable
org.apache.logging.log4j.core.config.LoggerConfig
public class LoggerConfig
Logger object that is created via configuration.
Nested Class Summary | |
---|---|
static class |
LoggerConfig.RootLogger
The root Logger. |
Constructor Summary | |
---|---|
|
LoggerConfig()
Default constructor. |
|
LoggerConfig(String name,
Level level,
boolean additive)
Constructor that sets the name, level and additive values. |
protected |
LoggerConfig(String name,
List<AppenderRef> appenders,
Filter filter,
Level level,
boolean additive)
|
Method Summary | |
---|---|
void |
addAppender(Appender appender,
Level level,
Filter filter)
Add an Appender to the LoggerConfig. |
protected void |
clearAppenders()
Remove all Appenders. |
LogEvent |
createEvent(String loggerName,
Marker marker,
String fqcn,
Level level,
Message data,
Throwable t)
Create a log event. |
static LoggerConfig |
createLogger(String additivity,
String loggerLevel,
String loggerName,
AppenderRef[] refs,
Filter filter)
Factory method to create a LoggerConfig. |
List<AppenderRef> |
getAppenderRefs()
Return the Appender references. |
Map<String,Appender> |
getAppenders()
Return all Appenders as a Map. |
Filter |
getFilter()
Return the Filter. |
Level |
getLevel()
Return the logging Level. |
LogEventFactory |
getLogEventFactory()
Return the LogEventFactory. |
String |
getName()
Return the name of the LoggerConfig. |
LoggerConfig |
getParent()
Return the parent of this LoggerConfig. |
boolean |
isAdditive()
Return the valid of the additive flag. |
void |
log(LogEvent event)
Logs an event. |
void |
log(String loggerName,
Marker marker,
String fqcn,
Level level,
Message data,
Throwable t)
Log an event. |
void |
removeAppender(String name)
Remove the Appender with the specific name. |
void |
setAdditive(boolean additive)
Set the additive setting. |
void |
setConfigurationMonitor(ConfigurationMonitor monitor)
Set the ConfigurationMonitor that will detect configuration changes. |
void |
setLevel(Level level)
Set the logging Level. |
void |
setLogEventFactory(LogEventFactory logEventFactory)
Set the LogEventFactory. |
void |
setParent(LoggerConfig parent)
Set the parent of this LoggerConfig. |
String |
toString()
|
Methods inherited from class org.apache.logging.log4j.core.filter.Filterable |
---|
addFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LoggerConfig()
public LoggerConfig(String name, Level level, boolean additive)
name
- The Logger name.level
- The Level.additive
- true if the Logger is additive, false otherwise.protected LoggerConfig(String name, List<AppenderRef> appenders, Filter filter, Level level, boolean additive)
Method Detail |
---|
public Filter getFilter()
Filterable
getFilter
in interface Filtering
getFilter
in class Filterable
public void setConfigurationMonitor(ConfigurationMonitor monitor)
monitor
- The ConfigurationMonitor.public String getName()
public void setParent(LoggerConfig parent)
parent
- the parent LoggerConfig.public LoggerConfig getParent()
public void addAppender(Appender appender, Level level, Filter filter)
appender
- The Appender to add.level
- The Level to use.filter
- A Filter for the Appender reference.public void removeAppender(String name)
name
- The name of the Appender.public Map<String,Appender> getAppenders()
protected void clearAppenders()
public List<AppenderRef> getAppenderRefs()
public void setLevel(Level level)
level
- The logging Level.public Level getLevel()
public LogEventFactory getLogEventFactory()
public void setLogEventFactory(LogEventFactory logEventFactory)
logEventFactory
- the LogEventFactory.public boolean isAdditive()
public void setAdditive(boolean additive)
additive
- true if thee LoggerConfig should be additive, false otherwise.public void log(String loggerName, Marker marker, String fqcn, Level level, Message data, Throwable t)
loggerName
- The name of the Logger.marker
- A Marker or null if none is present.fqcn
- The fully qualified class name of the caller.level
- The event Level.data
- The Message.t
- A Throwable or null.public void log(LogEvent event)
event
- Yhe log event.public LogEvent createEvent(String loggerName, Marker marker, String fqcn, Level level, Message data, Throwable t)
createEvent
in interface LogEventFactory
loggerName
- The name of the Logger.marker
- An optional Marker.fqcn
- The fully qualified class name of the caller.level
- The event Level.data
- The Message.t
- An optional Throwable.
public String toString()
toString
in class Object
public static LoggerConfig createLogger(String additivity, String loggerLevel, String loggerName, AppenderRef[] refs, Filter filter)
additivity
- True if additive, false otherwise.loggerLevel
- The Level to be associated with the Logger.loggerName
- The name of the Logger.refs
- An array of Appender names.filter
- A Filter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |