Examples

Package files

NewLogger creates a log.Logger whose output is written to the
system log service with the specified priority, a combination of
the syslog facility and severity. The logFlag argument is the flag
set passed through to log.New to create the Logger.

The Priority is a combination of the syslog facility and
severity. For example, LOG_ALERT | LOG_FTP sends an alert severity
message from the FTP facility. The default severity is LOG_EMERG;
the default facility is LOG_KERN.

const (
// From /usr/include/sys/syslog.h.// These are the same on Linux, BSD, and OS X.LOG_EMERGPriority = iotaLOG_ALERTLOG_CRITLOG_ERRLOG_WARNINGLOG_NOTICELOG_INFOLOG_DEBUG
)

const (
// From /usr/include/sys/syslog.h.// These are the same up to LOG_FTP on Linux, BSD, and OS X.LOG_KERNPriority = iota << 3
LOG_USERLOG_MAILLOG_DAEMONLOG_AUTHLOG_SYSLOGLOG_LPRLOG_NEWSLOG_UUCPLOG_CRONLOG_AUTHPRIVLOG_FTPLOG_LOCAL0LOG_LOCAL1LOG_LOCAL2LOG_LOCAL3LOG_LOCAL4LOG_LOCAL5LOG_LOCAL6LOG_LOCAL7
)

Dial establishes a connection to a log daemon by connecting to
address raddr on the specified network. Each write to the returned
writer sends a log message with the facility and severity
(from priority) and tag. If tag is empty, the os.Args[0] is used.
If network is empty, Dial will connect to the local syslog server.
Otherwise, see the documentation for net.Dial for valid values
of network and raddr.

New establishes a new connection to the system log daemon. Each
write to the returned writer sends a log message with the given
priority (a combination of the syslog facility and severity) and
prefix tag. If tag is empty, the os.Args[0] is used.

Bugs

This package is not implemented on Windows. As the
syslog package is frozen, Windows users are encouraged to
use a package outside of the standard library. For background,
see https://golang.org/issue/1108.