The handler module defines the LogHandler interface, as well as several simple handler implementations that can be used or extended by SLF4D providers.



class CachingLogHandler

A log handler that simply appends all messages it receives to an internal array. This can be useful for testing, but should not be used for general runtime logging due to the need to synchronize access to the internal message cache.

class DiscardingLogHandler

A log handler that discards all messages. Useful for testing.

class FilterLogHandler

A handler that applies a filter to log messages, and only passes messages to its internal handler if the filter returns true.

class LevelMappedLogHandler

A handler that sends log messages to different handlers depending on the level of the message. For example, you could create a level-mapped log handler that sends INFO messages to stdout, but sends ERROR messages to an email notification service.

class MultiLogHandler

A log handler that simply passes any log message it receives to a list of other handlers. Note that handlers should only be added at application startup, because the handle method is not synchronized to improve performance.


interface LogHandler

The interface for any component that consumes log messages generated by a Logger. Only messages whose level is greater than or equal to the logger's level will be sent to handlers. For example, a Logger configured at an INFO log level will send INFO, WARN, and ERROR messages, but not DEBUG or TRACE.