logs

package
v1.247349.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOutputStopped = errors.New("Output plugin stopped")

Functions

This section is empty.

Types

type LogAgent

type LogAgent struct {
	Config *config.Config
	// contains filtered or unexported fields
}

LogAgent is the agent handles pure log pipelines

func NewLogAgent

func NewLogAgent(c *config.Config) *LogAgent

func (*LogAgent) Run

func (l *LogAgent) Run(ctx context.Context)

LogAgent will scan all input and output plugins for LogCollection and LogBackend. And connect all the LogSrc from the LogCollection found to the respective LogDest based on the configured "destination", and "name"

type LogBackend

type LogBackend interface {
	CreateDest(string, string) LogDest
}

A LogBackend is able to return a LogDest of a given name. The same name should always return the same LogDest.

type LogCollection

type LogCollection interface {
	FindLogSrc() []LogSrc
}

A LogCollection is a collection of LogSrc, a plugin which can provide many LogSrc

type LogDest

type LogDest interface {
	Publish(events []LogEvent) error
}

A LogDest represents a final endpoint where log events are published to. e.g. a particualr log stream in cloudwatchlogs.

type LogEvent

type LogEvent interface {
	Message() string
	Time() time.Time
	Done()
}

type LogSrc

type LogSrc interface {
	SetOutput(func(LogEvent))
	Group() string
	Stream() string
	Destination() string
	Description() string
	Stop()
}

A LogSrc is a single source where log events are generated e.g. a single log file

Jump to

Keyboard shortcuts

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