Class Logger
java.lang.Object
org.jpos.util.Logger
- All Implemented Interfaces:
Configurable, LogProducer
Peer class Logger forwards LogEvents generated by LogSources
to LogListeners.
This little tutorial give you additional information on how to extend the jPOS's Logger subsystem.
This little tutorial give you additional information on how to extend the jPOS's Logger subsystem.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a log listener to this logger.voiddestroy()destroy loggerReturns the current configuration.static LoggerReturns the logger instance registered under the given name, creating one if necessary.getName()Returns this logger's registered name.booleanUsed by heavy used methods to avoid LogEvent creationstatic voidDispatches a log event to the appropriate logger and its listeners.voidRemoves all registered log listeners.voidRemoves a specific log listener.voidConfigures this object with the suppliedConfiguration.voidassociates this Logger with a name using NameRegistrar
-
Field Details
-
NRPREFIX
-
-
Constructor Details
-
Logger
public Logger()Default constructor.
-
-
Method Details
-
getConfiguration
Returns the current configuration.- Returns:
- configuration object
-
setConfiguration
Description copied from interface:ConfigurableConfigures this object with the suppliedConfiguration.- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object- Throws:
ConfigurationException- if the configuration is invalid
-
addListener
Adds a log listener to this logger.- Specified by:
addListenerin interfaceLogProducer- Parameters:
l- the listener to add
-
removeListener
Description copied from interface:LogProducerRemoves a specific log listener.- Specified by:
removeListenerin interfaceLogProducer- Parameters:
l- the listener to remove
-
removeAllListeners
Description copied from interface:LogProducerRemoves all registered log listeners.- Specified by:
removeAllListenersin interfaceLogProducer
-
log
-
setName
-
destroy
destroy logger -
getLogger
-
getName
-
hasListeners
Used by heavy used methods to avoid LogEvent creation- Returns:
- true if Logger has associated LogListsners
-