Package org.snmp4j.log
Class LogFactory
java.lang.Object
org.snmp4j.log.LogFactory
- Direct Known Subclasses:
 ConsoleLogFactory,JavaLogFactory
The 
LogFactory singleton is used by SNMP4J to determine
 the logging framework used to process SNMP4J log messages. By default
 NoLogger instances are used.- Since:
 - 1.2.1
 - Version:
 - 1.8
 - Author:
 - Frank Fock
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected LogAdapterCreates a Logger for the specified class.protected LogAdaptercreateLogger(String className) Creates a Logger for the specified class.static LogFactoryGets the log factory to be used by SNMP4J.static LogAdapterGets the logger for the supplied class.static LogAdapterGets the logger for the supplied class name.Returns the top level logger.loggers()Returns all available LogAdapters in depth first order.static voidsetLogFactory(LogFactory factory) Sets the log factory to be used by SNMP4J. 
- 
Field Details
- 
SNMP4J_LOG_FACTORY_SYSTEM_PROPERTY
- See Also:
 
 
 - 
 - 
Constructor Details
- 
LogFactory
public LogFactory() 
 - 
 - 
Method Details
- 
getLogger
Gets the logger for the supplied class.- Parameters:
 c- the class for which a logger needs to be created.- Returns:
 - the 
LogAdapterinstance. 
 - 
getRootLogger
Returns the top level logger.- Returns:
 - a LogAdapter instance.
 - Since:
 - 1.7
 
 - 
getLogger
Gets the logger for the supplied class name.- Parameters:
 className- the class name for which a logger needs to be created.- Returns:
 - the 
LogAdapterinstance. - Since:
 - 1.7
 
 - 
createLogger
Creates a Logger for the specified class. This method returns theNoLoggerlogger instance which disables logging. Overwrite this method the return a custom logger to enable logging for SNMP4J.- Parameters:
 c- the class for which a logger needs to be created.- Returns:
 - the 
LogAdapterinstance. 
 - 
createLogger
Creates a Logger for the specified class. This method returns theNoLoggerlogger instance which disables logging. Overwrite this method the return a custom logger to enable logging for SNMP4J.- Parameters:
 className- the class name for which a logger needs to be created.- Returns:
 - the 
LogAdapterinstance. - Since:
 - 1.7
 
 - 
setLogFactory
Sets the log factory to be used by SNMP4J. Call this method before any other SNMP4J class is referenced or created to set and use a custom log factory.- Parameters:
 factory- aLogFactoryinstance.
 - 
getLogFactory
Gets the log factory to be used by SNMP4J. If the log factory has not been initialized bysetLogFactory(org.snmp4j.log.LogFactory)a new instance ofLogFactoryis returned.- Returns:
 - a 
LogFactoryinstance. - Since:
 - 1.7
 
 - 
loggers
Returns all available LogAdapters in depth first order.- Returns:
 - a read-only Iterator.
 - Since:
 - 1.7
 
 
 -