README.md (1236B)
1 go-syslog [![Build Status](https://travis-ci.org/mcuadros/go-syslog.svg?branch=master)](https://travis-ci.org/mcuadros/go-syslog) [![GoDoc](http://godoc.org/github.com/mcuadros/go-syslog?status.svg)](hhttps://godoc.org/gopkg.in/mcuadros/go-syslog.v2) [![GitHub release](https://img.shields.io/github/release/mcuadros/go-syslog.svg)](https://github.com/mcuadros/go-syslog/releases) 2 ============================== 3 4 Syslog server library for go, build easy your custom syslog server over UDP, TCP or Unix sockets using RFC3164, RFC6587 or RFC5424 5 6 Installation 7 ------------ 8 9 The recommended way to install go-syslog 10 11 ``` 12 go get gopkg.in/mcuadros/go-syslog.v2 13 ``` 14 15 Examples 16 -------- 17 18 How import the package 19 20 ```go 21 import "gopkg.in/mcuadros/go-syslog.v2" 22 ``` 23 24 Example of a basic syslog [UDP server](example/basic_udp.go): 25 26 ```go 27 channel := make(syslog.LogPartsChannel) 28 handler := syslog.NewChannelHandler(channel) 29 30 server := syslog.NewServer() 31 server.SetFormat(syslog.RFC5424) 32 server.SetHandler(handler) 33 server.ListenUDP("0.0.0.0:514") 34 server.Boot() 35 36 go func(channel syslog.LogPartsChannel) { 37 for logParts := range channel { 38 fmt.Println(logParts) 39 } 40 }(channel) 41 42 server.Wait() 43 ``` 44 45 License 46 ------- 47 48 MIT, see [LICENSE](LICENSE)