log

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(config Config) *zap.Logger

Types

type Config

type Config struct {
	// StdOutLogLevel is the log level for the standard out logger.
	StdOutLogLevel string
	// FileOutLogLevel is the log level for the file logger.
	FileOutLogLevel string
	// DisableRotating disables log rotation.
	DisableRotating bool
	// WriteTo is the output file for the logger. If empty, logs will be written to stderr.
	WriteTo string
	// MaxSize is the maximum size in megabytes before log is rotated.
	MaxSize int
	// MaxBackups is the maximum number of old log files to retain.
	MaxBackups int
	// MaxAge is the maximum number of days to retain an old log file.
	MaxAge int
	// Compress determines if the rotated log files should be compressed.
	Compress bool
	// LogSamplePeriod is the duration in which we de-dupe identical log messages.
	LogSamplePeriod time.Duration
}

Config is the configuration for the logger.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates a default configuration for the logger.

Jump to

Keyboard shortcuts

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