- java.lang.Object
-
- org.snmp4j.log.LogFactory
-
- org.snmp4j.log.JavaLogFactory
-
public class JavaLogFactory extends LogFactory
TheJavaLogFactory
implements a SNMP4J LogFactory for Java logging. In order to use Java'sjava.util.logging
for logging SNMP4J log messages the staticLogFactory.setLogFactory(org.snmp4j.log.LogFactory)
method has to be used before any SNMP4J class is referenced or instantiated.- Version:
- 3.0.5
- Author:
- Frank Fock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JavaLogFactory.JavaLogAdapterIterator
-
Field Summary
-
Fields inherited from class org.snmp4j.log.LogFactory
SNMP4J_LOG_FACTORY_SYSTEM_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description JavaLogFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.LogAdapter
getRootLogger()
Returns the top level logger.java.util.Iterator<LogAdapter>
loggers()
Returns all available LogAdapters in depth first order.-
Methods inherited from class org.snmp4j.log.LogFactory
getLogFactory, getLogger, getLogger, setLogFactory
-
-
-
-
Method Detail
-
createLogger
protected LogAdapter createLogger(java.lang.Class c)
Description copied from class:LogFactory
Creates a Logger for the specified class. This method returns theNoLogger
logger instance which disables logging. Overwrite this method the return a custom logger to enable logging for SNMP4J.- Overrides:
createLogger
in classLogFactory
- Parameters:
c
- the class for which a logger needs to be created.- Returns:
- the
LogAdapter
instance.
-
createLogger
protected LogAdapter createLogger(java.lang.String className)
Description copied from class:LogFactory
Creates a Logger for the specified class. This method returns theNoLogger
logger instance which disables logging. Overwrite this method the return a custom logger to enable logging for SNMP4J.- Overrides:
createLogger
in classLogFactory
- Parameters:
className
- the class name for which a logger needs to be created.- Returns:
- the
LogAdapter
instance.
-
getRootLogger
public LogAdapter getRootLogger()
Description copied from class:LogFactory
Returns the top level logger.- Overrides:
getRootLogger
in classLogFactory
- Returns:
- a LogAdapter instance.
-
loggers
public java.util.Iterator<LogAdapter> loggers()
Description copied from class:LogFactory
Returns all available LogAdapters in depth first order.- Overrides:
loggers
in classLogFactory
- Returns:
- a read-only Iterator.
-
-