java.lang.Object
org.snmp4j.log.LogFactory
org.snmp4j.log.ConsoleLogFactory
The
ConsoleLogFactory
implements a SNMP4J LogFactory for
system out. In order to use simple stdout logging for SNMP4J, the
static LogFactory.setLogFactory(org.snmp4j.log.LogFactory)
method has to be used before
any SNMP4J class is referenced or instantiated.- Since:
- 1.6
- Version:
- 1.7
- Author:
- Frank Fock
-
Field Summary
Fields inherited from class org.snmp4j.log.LogFactory
SNMP4J_LOG_FACTORY_LOG_HANDLER_DEFAULT_PREFIX, SNMP4J_LOG_FACTORY_LOGGER_DEFAULT_PREFIX, SNMP4J_LOG_FACTORY_SYSTEM_PROPERTY, SNMP4J_LOG_HANDLER, SNMP4J_LOG_HANDLER_LIST, SNMP4J_LOG_ID, SNMP4J_LOG_LEVEL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected LogAdapter
createLogger
(Class<?> c) Creates a Logger for the specified class.protected LogAdapter
createLogger
(String className) Creates a Logger for the specified class.Returns the top level logger.Methods inherited from class org.snmp4j.log.LogFactory
addHandler, getLogFactory, getLogger, getLogger, getLoggerConfigPrefix, getLogHandlerConfigPrefix, loggers, removeAllHandlers, reset, resetLogger, setLogFactory, setLoggerConfigPrefix, setLogHandlerConfigPrefix, updateConfiguration, updateLogger, writeConfiguration, writeConfiguration, writeConfiguration
-
Constructor Details
-
ConsoleLogFactory
public ConsoleLogFactory()
-
-
Method Details
-
createLogger
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
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
Description copied from class:LogFactory
Returns the top level logger.- Overrides:
getRootLogger
in classLogFactory
- Returns:
- a LogAdapter instance.
-