|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.AbstractFilterable
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,
Property[] properties,
Configuration config)
|
Method Summary | |
---|---|
void |
addAppender(Appender appender,
Level level,
Filter filter)
Adds an Appender to the LoggerConfig. |
protected void |
clearAppenders()
Removes all Appenders. |
LogEvent |
createEvent(String loggerName,
Marker marker,
String fqcn,
Level level,
Message data,
List<Property> properties,
Throwable t)
Creates a log event. |
static LoggerConfig |
createLogger(String additivity,
String levelName,
String loggerName,
AppenderRef[] refs,
Property[] properties,
Configuration config,
Filter filter)
Factory method to create a LoggerConfig. |
List<AppenderRef> |
getAppenderRefs()
Returns the Appender references. |
Map<String,Appender<?>> |
getAppenders()
Returns all Appenders as a Map. |
Filter |
getFilter()
Returns the Filter. |
Level |
getLevel()
Returns the logging Level. |
LogEventFactory |
getLogEventFactory()
Returns the LogEventFactory. |
String |
getName()
Returns the name of the LoggerConfig. |
LoggerConfig |
getParent()
Returns the parent of this LoggerConfig. |
boolean |
isAdditive()
Returns 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)
Logs an event. |
void |
removeAppender(String name)
Removes the Appender with the specific name. |
void |
setAdditive(boolean additive)
Sets the additive setting. |
void |
setLevel(Level level)
Sets the logging Level. |
void |
setLogEventFactory(LogEventFactory logEventFactory)
Sets the LogEventFactory. |
void |
setParent(LoggerConfig parent)
Sets the parent of this LoggerConfig. |
String |
toString()
|
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable |
---|
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, Property[] properties, Configuration config)
Method Detail |
---|
public Filter getFilter()
AbstractFilterable
getFilter
in interface Filterable
getFilter
in class AbstractFilterable
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
- The log event.public LogEvent createEvent(String loggerName, Marker marker, String fqcn, Level level, Message data, List<Property> properties, 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.properties
- Properties to be added to the log event.t
- An optional Throwable.
public String toString()
toString
in class Object
public static LoggerConfig createLogger(String additivity, String levelName, String loggerName, AppenderRef[] refs, Property[] properties, Configuration config, Filter filter)
additivity
- True if additive, false otherwise.levelName
- The Level to be associated with the Logger.loggerName
- The name of the Logger.refs
- An array of Appender names.properties
- Properties to pass to the Logger.config
- The Configuration.filter
- A Filter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2013 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.