Documentation
¶
Overview ¶
Package syslog provides message notification integration for local or remote syslogs.
Usage:
package main
import (
"context"
"log"
sl "log/syslog"
"github.com/nikoksr/notify"
"github.com/nikoksr/notify/service/syslog"
)
func main() {
syslogSvc, err := syslog.New(sl.LOG_USER, "")
if err != nil {
log.Fatalf("syslog.New() failed: %v", err)
}
notify.UseServices(syslogSvc)
err = notify.Send(context.Background(), "TEST", "Hello, World!")
if err != nil {
log.Fatalf("notify.Send() failed: %v", err)
}
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service encapsulates a syslog daemon writer.
func New ¶
New returns a new instance of a Service notification service. Parameter 'tag' is used as a log prefix and may be left empty, it has a fallback value.
func NewFromDial ¶
NewFromDial returns a new instance of a Service notification service. The underlying syslog writer establishes a connection to a log daemon by connecting to address raddr on the specified network. Parameter 'tag' is used as a log prefix and may be left empty, it has a fallback value. Calling NewFromDial with network and raddr being empty strings is equal in function to calling New directly.