apex

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

README

Logging handler for github.com/apex/logs that outputs the logs to UDP messages compatible with the logd server.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler converts Apex logs into logd UDP packets and transports them to a local logd server.

func New

func New() (*Handler, error)

New creates a new handler.

func NewHandler

func NewHandler(target string, buffer chan *log.Entry, stats logs.Stats) (*Handler, error)

NewHandler creates a new handler with specific settings

func (*Handler) Buffer

func (h *Handler) Buffer(buf chan *log.Entry) chan *log.Entry

Buffer configures the internal buffer to use a provided channel. If the channel is nil, the method returns the current buffer channel.

func (*Handler) HandleLog

func (h *Handler) HandleLog(e *log.Entry) error

HandleLog by converting to UDP and sending to logd.

func (*Handler) Stats

func (h *Handler) Stats(stats logs.Stats)

Stats configures the statistics handler for the logger. If set to nil (the default) the logger does not report stats.

Jump to

Keyboard shortcuts

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