View Source
const PluginName = "docker_logger"


This section is empty.


This section is empty.


type DockerLogger

type DockerLogger interface {
	Start(*StartOpts) error
	Stop() error

DockerLogger is a small utility to forward logs from a docker container to a target destination

func LaunchDockerLogger

func LaunchDockerLogger(logger hclog.Logger) (DockerLogger, *plugin.Client, error)

LaunchDockerLogger launches an instance of DockerLogger

func NewDockerLogger

func NewDockerLogger(logger hclog.Logger) DockerLogger

NewDockerLogger returns an implementation of the DockerLogger interface

func ReattachDockerLogger

func ReattachDockerLogger(reattachCfg *plugin.ReattachConfig) (DockerLogger, *plugin.Client, error)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields


Plugin is the go-plugin implementation

func NewPlugin

func NewPlugin(impl DockerLogger) *Plugin

func (*Plugin) GRPCClient

func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient returns a client side implementation of the plugin

func (*Plugin) GRPCServer

func (p *Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer registered the server side implementation with the grpc server

type StartOpts

type StartOpts struct {
	// Endpoint sets the docker client endpoint, defaults to environment if not set
	Endpoint string

	// ContainerID of the container to monitor logs for
	ContainerID string
	TTY         bool

	// Stdout path to fifo
	Stdout string
	//Stderr path to fifo
	Stderr string

	// StartTime is the Unix time that the docker logger should fetch logs beginning
	// from
	StartTime int64

	// TLS settings for docker client
	TLSCert string
	TLSKey  string
	TLSCA   string

StartOpts are the options needed to start docker log monitoring


Path Synopsis