logs

package
v1.247357.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 6 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)

Run 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, int) 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
	Retention() int
	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