hslogger-1.1.0: Versatile logging frameworkSource codeContentsIndex
System.Log.Handler.Syslog
Portabilityportable
Stabilityprovisional
MaintainerJohn Goerzen <jgoerzen@complete.org>
Contents
Handler Initialization
Advanced handler initialization
Data Types
Description

Syslog handler for the Haskell Logging Framework

Written by John Goerzen, jgoerzen@complete.org

This module implements an interface to the Syslog service commonly found in Unix/Linux systems. This interface is primarily of interest to developers of servers, as Syslog does not typically display messages in an interactive fashion.

This module is written in pure Haskell and is capable of logging to a local or remote machine using the Syslog protocol.

You can create a new Syslog LogHandler by calling openlog.

More information on the Haskell Logging Framework can be found at System.Log.Logger. This module can also be used outside of the rest of that framework for those interested in that.

Synopsis
openlog :: String -> [Option] -> Facility -> Priority -> IO SyslogHandler
openlog_local :: String -> String -> [Option] -> Facility -> Priority -> IO SyslogHandler
openlog_remote :: Family -> HostName -> PortNumber -> String -> [Option] -> Facility -> Priority -> IO SyslogHandler
openlog_generic :: Socket -> SockAddr -> String -> [Option] -> Facility -> Priority -> IO SyslogHandler
data Facility
= KERN
| USER
| MAIL
| DAEMON
| AUTH
| SYSLOG
| LPR
| NEWS
| UUCP
| CRON
| AUTHPRIV
| FTP
| LOCAL0
| LOCAL1
| LOCAL2
| LOCAL3
| LOCAL4
| LOCAL5
| LOCAL6
| LOCAL7
data Option
= PID
| PERROR
Handler Initialization
openlog :: String -> [Option] -> Facility -> Priority -> IO SyslogHandlerSource

Initialize the Syslog system using the local system's default interface, /dev/log. Will return a new LogHandler.

On Windows, instead of using /dev/log, this will attempt to send UDP messages to something listening on the syslog port (514) on localhost.

Use openlog_remote if you need more control.

Advanced handler initialization
openlog_local :: String -> String -> [Option] -> Facility -> Priority -> IO SyslogHandlerSource

Initialize the Syslog system using an arbitrary Unix socket (FIFO).

Not supported under Windows.

openlog_remote :: Family -> HostName -> PortNumber -> String -> [Option] -> Facility -> Priority -> IO SyslogHandlerSource
Log to a remote server via UDP.
openlog_generic :: Socket -> SockAddr -> String -> [Option] -> Facility -> Priority -> IO SyslogHandlerSource
The most powerful initialization mechanism. Takes an open datagram socket.
Data Types
data Facility Source
Facilities are used by the system to determine where messages are sent.
Constructors
KERN
USER
MAIL
DAEMON
AUTH
SYSLOG
LPR
NEWS
UUCP
CRON
AUTHPRIV
FTP
LOCAL0
LOCAL1
LOCAL2
LOCAL3
LOCAL4
LOCAL5
LOCAL6
LOCAL7
show/hide Instances
data Option Source
Options for openlog.
Constructors
PID
PERROR
show/hide Instances
Produced by Haddock version 2.4.2