file

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultFileChannelSize is the default size of the data channel
	DefaultFileChannelSize = 100

	// DefaultFileWorkers is the default number of worker goroutines
	DefaultFileWorkers = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File implements the Output interface for file writes

func New

func New(logger *zap.Logger, path string, workers int, rotation RotationOptions) (*File, error)

New creates a new File output instance

func (*File) Stop

func (f *File) Stop(ctx context.Context) error

Stop gracefully stops workers and closes the writer

func (*File) Write

func (f *File) Write(ctx context.Context, data output.LogRecord) error

Write enqueues data for file workers.

type RotationOptions

type RotationOptions struct {
	MaxSizeMB  int
	MaxBackups int
	MaxAgeDays int
	Compress   bool
	LocalTime  bool
}

RotationOptions contains file rotation settings

Jump to

Keyboard shortcuts

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