syslogish

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

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 implements a UDP-based "syslog-like" server. Like syslog, as described by RFC 3164, it expects that each packet contains a single log message and that, conversely, log messages are encapsulated in their entirety by a single packet, however, no attempt is made to parse the messages received or validate that they conform to the specification.

func NewServer

func NewServer(bindHost string, bindPort int) (*Server, error)

NewServer returns a pointer to a new Server instance.

func (*Server) DestroyLogs

func (s *Server) DestroyLogs(app string) error

DestroyLogs deletes all logs for a specified app by delegating to the server's underlying storage.Adapter.

func (*Server) Listen

func (s *Server) Listen()

Listen starts the server's main loop.

func (*Server) ReadLogs

func (s *Server) ReadLogs(app string, lines int) ([]string, error)

ReadLogs returns a specified number of log lines (if available) for a specified app by delegating to the server's underlying storage.Adapter.

func (*Server) ReopenLogs

func (s *Server) ReopenLogs() error

ReopenLogs delegate to the server's underlying storage.Adapter to, if applicable, refresh references to underlying storage mechanisms. This is useful, for instance, to ensure logging continues smoothly after log rotation when file-based storage is in use.

func (*Server) SetDrain

func (s *Server) SetDrain(drain drain.LogDrain)

SetDrain permits a server's underlying drain.LogDrain to be reconfigured (replaced) at runtime.

func (*Server) SetStorageAdapter

func (s *Server) SetStorageAdapter(storageAdapter storage.Adapter)

SetStorageAdapter permits a server's underlying storage.Adapter to be reconfigured (replaced) at runtime.

Jump to

Keyboard shortcuts

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