local

package
v25.0.17+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 143 modules, 398 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

Overview

Package local provides a logger implementation that stores logs on disk.

Log messages are encoded as protobufs with a header and footer for each message. The header and footer are big-endian binary encoded uint32 values which indicate the size of the log message. The header and footer of each message allows you to efficiently read through a file either forwards or in backwards (such as is the case when tailing a file)

Example log message format: [22][This is a log message.][22][28][This is another log message.][28]

Index

Constants

View Source
const (
	// Name is the name of the driver
	Name = "local"
)

Variables

View Source
var LogOptKeys = map[string]bool{
	"max-file": true,
	"max-size": true,
	"compress": true,
}

LogOptKeys are the keys names used for log opts passed in to initialize the driver.

Functions

func New

func New(info logger.Info) (logger.Logger, error)

New creates a new local logger You must provide the `LogPath` in the passed in info argument, this is the file path that logs are written to.

func ValidateLogOpt

func ValidateLogOpt(cfg map[string]string) error

ValidateLogOpt looks for log driver specific options.

Types

type CreateConfig

type CreateConfig struct {
	DisableCompression bool
	MaxFileSize        int64
	MaxFileCount       int
}

CreateConfig is used to configure new instances of driver

Jump to

Keyboard shortcuts

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