logmgr

package
v1.4.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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