logger

package
v1.4.2-0...-4e9280f Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReadLogsNotSupported = errors.New("configured logging reader does not support reading")

Functions

func RegisterLogDriver

func RegisterLogDriver(name string, c Creator) error

RegisterLogDriver registers the given logging driver builder with given logging driver name.

Types

type Context

type Context struct {
	Config              map[string]string
	ContainerID         string
	ContainerName       string
	ContainerEntrypoint string
	ContainerArgs       []string
	ContainerImageID    string
	ContainerImageName  string
	ContainerCreated    time.Time
	LogPath             string
}

Context provides enough information for a logging driver to do its function

func (*Context) Command

func (ctx *Context) Command() string

func (*Context) Hostname

func (ctx *Context) Hostname() (string, error)

type Copier

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

Copier can copy logs from specified sources to Logger and attach ContainerID and Timestamp. Writes are concurrent, so you need implement some sync in your logger

func NewCopier

func NewCopier(cid string, srcs map[string]io.Reader, dst Logger) (*Copier, error)

NewCopier creates new Copier

func (*Copier) Run

func (c *Copier) Run()

Run starts logs copying

func (*Copier) Wait

func (c *Copier) Wait()

Wait waits until all copying is done

type Creator

type Creator func(Context) (Logger, error)

Creator is a method that builds a logging driver instance with given context

func GetLogDriver

func GetLogDriver(name string) (Creator, error)

GetLogDriver provides the logging driver builder for a logging driver name.

type Logger

type Logger interface {
	Log(*Message) error
	Name() string
	Close() error
	GetReader() (io.Reader, error)
}

Logger is interface for docker logging drivers

type Message

type Message struct {
	ContainerID string
	Line        []byte
	Source      string
	Timestamp   time.Time
}

Message is datastructure that represents record from some container

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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