mirror of
1
Fork 0
gotosocial/vendor/gopkg.in/mcuadros/go-syslog.v2
tobi c111b239f7
Add optional syslog logrus hook (#343)
* add optional syslog logrus hook

* document syslog
2021-12-12 18:00:20 +01:00
..
format Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
internal/syslogparser Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
.travis.yml Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
LICENSE Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
README.md Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
doc.go Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
handler.go Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00
server.go Add optional syslog logrus hook (#343) 2021-12-12 18:00:20 +01:00

README.md

go-syslog Build Status GoDoc GitHub release

Syslog server library for go, build easy your custom syslog server over UDP, TCP or Unix sockets using RFC3164, RFC6587 or RFC5424

Installation

The recommended way to install go-syslog

go get gopkg.in/mcuadros/go-syslog.v2

Examples

How import the package

import "gopkg.in/mcuadros/go-syslog.v2"

Example of a basic syslog UDP server:

channel := make(syslog.LogPartsChannel)
handler := syslog.NewChannelHandler(channel)

server := syslog.NewServer()
server.SetFormat(syslog.RFC5424)
server.SetHandler(handler)
server.ListenUDP("0.0.0.0:514")
server.Boot()

go func(channel syslog.LogPartsChannel) {
    for logParts := range channel {
        fmt.Println(logParts)
    }
}(channel)

server.Wait()

License

MIT, see LICENSE