Skip to content

NextronSystems/simplesyslog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 {
        ...
    }
}