logd

package module
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: 6 Imported by: 0

README

A "local" UDP logging server that receives JSON log records and pushes them to a Redis Stream.

Each UDP packet sent to should be json data with the following format with the "fields" field being arbitrary structured data associated with the log record:

{
    "level":"info",
    "timestamp":"2018-07-08T22:44:46.578312921-07:00",
    "message":"A useful log message",
    "fields":{
        "frame":"abcdefg",
        "len":7,
        "session":"96befb055d045bd1f351210747e41c56"
    }
}

Test using netcat:

echo -n "{\"level\":\"info\",\"message\":\"hello world\"}" | nc -4u -w0 localhost 9044

The logging server does basic buffering of data and uses batch log updates to reduce load on Redis.

The logging server is configured via Redis and currently supports the following settings:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is the core logd.

func New

func New() *Server

New creates a new server.

func (*Server) Start

func (s *Server) Start() error

Start the server - blocks the thread.

func (*Server) Stop

func (s *Server) Stop()

Stop terminates the server (not thread safe).

func (*Server) UUID

func (s *Server) UUID() string

UUID generates a 24-byte UUID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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