package syslog

Import Path
	log/syslog (on golang.org and go.dev)

Dependency Relation
	imports 8 packages, and imported by 0 packages

Involved Source Files
	d-> doc.go
	    syslog.go
	    syslog_unix.go

Exported Type Names

type Priority int 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. func Dial(network, raddr string, priority Priority, tag string) (*Writer, error) func New(priority Priority, tag string) (*Writer, error) func NewLogger(p Priority, logFlag int) (*log.Logger, error) const LOG_ALERT const LOG_AUTH const LOG_AUTHPRIV const LOG_CRIT const LOG_CRON const LOG_DAEMON const LOG_DEBUG const LOG_EMERG const LOG_ERR const LOG_FTP const LOG_INFO const LOG_KERN const LOG_LOCAL0 const LOG_LOCAL1 const LOG_LOCAL2 const LOG_LOCAL3 const LOG_LOCAL4 const LOG_LOCAL5 const LOG_LOCAL6 const LOG_LOCAL7 const LOG_LPR const LOG_MAIL const LOG_NEWS const LOG_NOTICE const LOG_SYSLOG const LOG_USER const LOG_UUCP const LOG_WARNING
type Writer (struct) A Writer is a connection to a syslog server. (*T) Alert(m string) error (*T) Close() error (*T) Crit(m string) error (*T) Debug(m string) error (*T) Emerg(m string) error (*T) Err(m string) error (*T) Info(m string) error (*T) Notice(m string) error (*T) Warning(m string) error (*T) Write(b []byte) (int, error) *T : io.Closer *T : io.WriteCloser *T : io.Writer func Dial(network, raddr string, priority Priority, tag string) (*Writer, error) func New(priority Priority, tag string) (*Writer, error)
Exported Values
func Dial(network, raddr string, priority Priority, tag string) (*Writer, error) 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.
const LOG_ALERT Priority = 1
const LOG_AUTH Priority = 32
const LOG_CRIT Priority = 2
const LOG_CRON Priority = 72
const LOG_DAEMON Priority = 24
const LOG_DEBUG Priority = 7
const LOG_EMERG Priority = 0 From /usr/include/sys/syslog.h. These are the same on Linux, BSD, and OS X.
const LOG_ERR Priority = 3
const LOG_FTP Priority = 88
const LOG_INFO Priority = 6
const LOG_KERN Priority = 0 From /usr/include/sys/syslog.h. These are the same up to LOG_FTP on Linux, BSD, and OS X.
const LOG_LOCAL0 Priority = 128
const LOG_LOCAL1 Priority = 136
const LOG_LOCAL2 Priority = 144
const LOG_LOCAL3 Priority = 152
const LOG_LOCAL4 Priority = 160
const LOG_LOCAL5 Priority = 168
const LOG_LOCAL6 Priority = 176
const LOG_LOCAL7 Priority = 184
const LOG_LPR Priority = 48
const LOG_MAIL Priority = 16
const LOG_NEWS Priority = 56
const LOG_NOTICE Priority = 5
const LOG_SYSLOG Priority = 40
const LOG_USER Priority = 8
const LOG_UUCP Priority = 64
func New(priority Priority, tag string) (*Writer, error) 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.
func NewLogger(p Priority, logFlag int) (*log.Logger, error) 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.