logmgr

package
v1.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogRotateBinary = "/usr/sbin/logrotate"

LogRotateBinary points to a logrotate path in the system. For testing purposes it should be overwritten to be empty.

Functions

This section is empty.

Types

type LogManager

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

LogManager runs logrotate for specified log files. TODO: Upload compressed logs into vSphere storage. TODO: Upload all logs into vSphere storage during graceful shutdown.

func NewLogManager

func NewLogManager(runInterval time.Duration) (*LogManager, error)

NewLogManager creates a new log manager instance.

func (*LogManager) AddLogRotate

func (lm *LogManager) AddLogRotate(logFilePath string, ri RotateInterval, maxSize, maxLogFiles int64, compress bool)

AddLogRotate adds a log to rotate.

func (*LogManager) Reload

func (lm *LogManager) Reload(*tether.ExecutorConfig) error

Reload - just to satisfy Tether interface.

func (*LogManager) Start

func (lm *LogManager) Start(system tether.System) error

Start log rotate loop.

func (*LogManager) Stop

func (lm *LogManager) Stop() error

Stop loop.

type RotateInterval

type RotateInterval uint32

RotateInterval defines a type for a log rotate frequency.

const (
	// Daily to trim logs daily.
	Daily RotateInterval = iota
	// Hourly to trim logs hourly.
	Hourly
	// Weekly to trim logs weekly.
	Weekly
	// Monthly to trim logs monthly.
	Monthly
)

Jump to

Keyboard shortcuts

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