1 Star 0 Fork 4

Fengzhi/go-syslog

forked from menuiis/go-syslog 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
basic_udp.go 446 Bytes
一键复制 编辑 原始数据 按行查看 历史
咏随风 提交于 2024-09-27 19:28 +08:00 . 返回对象优化
package main
import (
"fmt"
)
func main() {
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.ListenTCP("0.0.0.0:514")
server.Boot()
go func(channel syslog.LogPartsChannel) {
for logParts := range channel {
fmt.Println(logParts)
}
}(channel)
server.Wait()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fengzhi_1/go-syslog.git
git@gitee.com:fengzhi_1/go-syslog.git
fengzhi_1
go-syslog
go-syslog
f32490391394

搜索帮助