Maintainer | omeragacan@gmail.com |
---|---|
Stability | provisional |
Portability | Posix |
Safe Haskell | None |
Language | Haskell2010 |
Log messages to syslog over a network via TCP, with protocols such as RFC 5424 or RFC 3164.
Most of the code adapted from hsyslog-udp.
- initSyslog :: SyslogConfig -> IO SyslogConn
- type SyslogFn = Facility -> Severity -> Text -> IO ()
- data SyslogConn = SyslogConn {
- _syslogConnSend :: SyslogFn
- _syslogConnClose :: IO ()
- data SyslogConfig = SyslogConfig {
- _appName :: !AppName
- _hostName :: !HostName
- _processId :: !ProcessID
- _severityMask :: !SeverityMask
- _address :: !AddrInfo
- _protocol :: !Protocol
- defaultConfig :: HostName -> ServiceName -> IO (Maybe SyslogConfig)
- getAppName :: IO AppName
- getHostName :: IO HostName
- getProcessId :: IO ProcessID
- data Protocol
- rfc5424TCPProtocol :: Protocol
- rfc3164TCPProtocol :: Protocol
- rsyslogTCPProtocol :: Protocol
- data Priority :: *
- data Facility :: *
- data PriorityMask :: *
- newtype AppName :: * = AppName ByteString
- newtype HostName :: * = HostName ByteString
- newtype ProcessID :: * = ProcessID ByteString
- newtype MessageID :: * = MessageID ByteString
- type Severity = Priority
- type SeverityMask = PriorityMask
Haskell API to syslog via TCP
initSyslog :: SyslogConfig -> IO SyslogConn Source #
Connect to the remote syslog server over TCP.
See also documentation for SyslogConn
.
data SyslogConn Source #
SyslogConn | |
|
data SyslogConfig Source #
Configuration options for connecting and logging to your syslog socket.
SyslogConfig | |
|
defaultConfig :: HostName -> ServiceName -> IO (Maybe SyslogConfig) Source #
A helper for constructing a SyslogConfig
. Uses rsyslogTCPProtocol
.
Returns Nothing
when getAddrInfo
fails.
Utilities for constructing SyslogConfig
getAppName :: IO AppName #
getHostName :: IO HostName #
getProcessId :: IO ProcessID #
Protocols for use with SyslogConfig
Syslog TCP packet component datatypes
Re-exports from hsyslog
Log messages have a priority attached.
Syslog distinguishes various system facilities. Most applications should
log in USER
.
KERN | kernel messages |
USER | user-level messages (default unless set otherwise) |
mail system | |
DAEMON | system daemons |
AUTH | security/authorization messages |
SYSLOG | messages generated internally by syslogd |
LPR | line printer subsystem |
NEWS | network news subsystem |
UUCP | UUCP subsystem |
CRON | clock daemon |
AUTHPRIV | security/authorization messages (effectively equals |
FTP | ftp daemon (effectively equals |
LOCAL0 | reserved for local use |
LOCAL1 | reserved for local use |
LOCAL2 | reserved for local use |
LOCAL3 | reserved for local use |
LOCAL4 | reserved for local use |
LOCAL5 | reserved for local use |
LOCAL6 | reserved for local use |
LOCAL7 | reserved for local use |
data PriorityMask :: * #
withSyslog
options for the priority mask.
Newtypes for various String/Int values
Refer to RFC 5424 section 6.2 as to the purpose of each.
HostName ByteString | see |
ProcessID ByteString | see |
Type aliases
type SeverityMask = PriorityMask #