Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 645 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 645 Bytes

simplesyslog

Build Status

Simple SYSLOG client in Go

Installation

go get github.com/NextronSystems/simplesyslog

Example Usage

import (
    syslog "github.com/NextronSystems/simplesyslog"
)

const SyslogServer = "<hostname>:<port>"

func main() {
    client, err := syslog.NewClient(syslog.ConnectionUDP, SyslogServer)
    if err != nil {
        ...
    }
    defer client.Close()
    if err := client.Send("foo bar baz", syslog.LOG_LOCAL0|syslog.LOG_NOTICE); err != nil {
        ...
    }
}