public class LogFactory
extends java.lang.Object
LogFactory singleton is used by SNMP4J to determine
the logging framework used to process SNMP4J log messages. By default
NoLogger instances are used.| Modifier and Type | Field and Description |
|---|---|
private static boolean |
configChecked |
static java.lang.String |
SNMP4J_LOG_FACTORY_SYSTEM_PROPERTY |
private static LogFactory |
snmp4jLogFactory |
| Constructor and Description |
|---|
LogFactory() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
checkConfig() |
protected LogAdapter |
createLogger(java.lang.Class c)
Creates a Logger for the specified class.
|
protected LogAdapter |
createLogger(java.lang.String className)
Creates a Logger for the specified class.
|
private static void |
getFactoryFromSystemProperty() |
static LogFactory |
getLogFactory()
Gets the log factory to be used by SNMP4J.
|
static LogAdapter |
getLogger(java.lang.Class c)
Gets the logger for the supplied class.
|
static LogAdapter |
getLogger(java.lang.String className)
Gets the logger for the supplied class name.
|
LogAdapter |
getRootLogger()
Returns the top level logger.
|
java.util.Iterator |
loggers()
Returns all available LogAdapters in depth first order.
|
static void |
setLogFactory(LogFactory factory)
Sets the log factory to be used by SNMP4J.
|
public static final java.lang.String SNMP4J_LOG_FACTORY_SYSTEM_PROPERTY
private static LogFactory snmp4jLogFactory
private static boolean configChecked
public static LogAdapter getLogger(java.lang.Class c)
c - the class for which a logger needs to be created.LogAdapter instance.private static void checkConfig()
private static void getFactoryFromSystemProperty()
public LogAdapter getRootLogger()
public static LogAdapter getLogger(java.lang.String className)
className - the class name for which a logger needs to be created.LogAdapter instance.protected LogAdapter createLogger(java.lang.Class c)
NoLogger logger instance which disables logging.
Overwrite this method the return a custom logger to enable logging for
SNMP4J.c - the class for which a logger needs to be created.LogAdapter instance.protected LogAdapter createLogger(java.lang.String className)
NoLogger logger instance which disables logging.
Overwrite this method the return a custom logger to enable logging for
SNMP4J.className - the class name for which a logger needs to be created.LogAdapter instance.public static void setLogFactory(LogFactory factory)
factory - a LogFactory instance.public static LogFactory getLogFactory()
setLogFactory(org.snmp4j.log.LogFactory) a new instance of LogFactory
is returned.LogFactory instance.public java.util.Iterator loggers()