filebeatUdpWriter

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 5 Imported by: 0

README

FileBeat UDP Writer for ZeroLog AND Gin

Go Reference

FileBeat log writer for GIN-zerolog-udp-filebeat stack.

Usage

r := gin.New()

udpLogger, _ := filebeatUdpWriter.CreateLogger("localhost:8125") //you can catch the error here

r.Use(filebeatUdpWriter.GinHandle("gin", udpLogger))
r.Use(filebeatUdpWriter.GinHandle("gin", log.Logger))

https://pkg.go.dev/github.com/abbychau/filebeatUdpWriter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogger

func CreateLogger(address string) (zerolog.Logger, error)

func GinHandle

func GinHandle(serName string, logger zerolog.Logger) gin.HandlerFunc

Types

type Writer

type Writer struct {
	Conn *net.UDPConn
}

func (Writer) Write

func (w Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL