Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains implementation of most commonly used logging backends.
You can write your own backends, by implementing an instance of IsLogBackend
type class.
- data FastLoggerBackend
- data SyslogBackend
- data ChanLoggerBackend
- data ParallelBackend
- data NullBackend
- data Filtering b
- filtering :: IsLogBackend b => LogFilter -> LogBackendSettings b -> LogBackendSettings (Filtering b)
- excluding :: IsLogBackend b => LogFilter -> LogBackendSettings b -> LogBackendSettings (Filtering b)
- defStdoutSettings :: LogBackendSettings FastLoggerBackend
- defStderrSettings :: LogBackendSettings FastLoggerBackend
- defFileSettings :: FilePath -> LogBackendSettings FastLoggerBackend
- defaultSyslogSettings :: LogBackendSettings SyslogBackend
- defaultSyslogFormat :: Format
Documentation
This module contains several implementation of logging backend. A backend is some kind of target, where your messages will go. Each backend has its own specific settings.
Backends provided are:
- Fast-logger backend. It allows to write messages to stdout, stderr or arbitrary file.
- Syslog backend.
- Chan backend.
- Null backend. This discards all messages. Can be used to disable logging.
There are also some backend combinators:
- Filtering - passes messages, that match specified filter, to underlying backend.
- FilteringM - similar to Filtering, but allows to change the filter in runtime.
- Parallel - writes messages to several backends in parallel.
- Dynamic - allows to change underlying backend or its settings in runtime.
data FastLoggerBackend Source #
Fast-logger logging backend.
data SyslogBackend Source #
Syslog logging backend.
data ChanLoggerBackend Source #
Logging backend which writes all messages to the Chan
data ParallelBackend Source #
Logging backend that writes log messages to several other backends in parallel.
data NullBackend Source #
Null logging backend, which discards all messages
(passes them to devnull
, if you wish).
This can be used to disable logging.
Messages filtering backend. This backend passes a message to underlying backend, if this message conforms to specified filter.
IsLogBackend b => IsLogBackend (Filtering b) Source # | |
data LogBackendSettings (Filtering b) Source # | |
filtering :: IsLogBackend b => LogFilter -> LogBackendSettings b -> LogBackendSettings (Filtering b) Source #
Specify filter as LogFilter
.
excluding :: IsLogBackend b => LogFilter -> LogBackendSettings b -> LogBackendSettings (Filtering b) Source #
Exclude messages by filter.
Default settings
defStdoutSettings :: LogBackendSettings FastLoggerBackend Source #
Default settings for fast-logger stdout output
defStderrSettings :: LogBackendSettings FastLoggerBackend Source #
Default settings for fast-logger stderr output
defFileSettings :: FilePath -> LogBackendSettings FastLoggerBackend Source #
Default settings for fast-logger file output. This implies log rotation when log file size reaches 10Mb.
defaultSyslogSettings :: LogBackendSettings SyslogBackend Source #
Default settings for syslog backend
defaultSyslogFormat :: Format Source #
Default log message format fof syslog backend:
[{level}] {source}: {message}