file

package
v1.16.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Name = "file_logger"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path       string `json:"path"`
	MaxSize    int    `json:"max_size_mb"`
	MaxAge     int    `json:"max_age_days"`
	MaxBackups int    `json:"max_backups"`
	Compress   bool   `json:"compress"`
	Level      string `json:"level"`
}

Config holds the configuration for the file logger plugin.

type Factory

type Factory struct{}

Factory creates file logger plugin instances.

func (*Factory) New

func (*Factory) New(manager *plugins.Manager, config any) plugins.Plugin

New creates a new file logger plugin instance.

func (*Factory) Validate

func (*Factory) Validate(manager *plugins.Manager, config []byte) (any, error)

Validate validates the configuration for the file logger plugin.

type Plugin

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

Plugin implements the logger plugin interface for file-based logging.

func (*Plugin) Logger

func (p *Plugin) Logger() slog.Handler

func (*Plugin) Reconfigure

func (p *Plugin) Reconfigure(ctx context.Context, config any)

Reconfigure updates the file logger configuration.

func (*Plugin) Start

func (p *Plugin) Start(context.Context) error

Start initializes the file logger and starts writing logs to the configured file.

func (*Plugin) Stop

func (p *Plugin) Stop(context.Context)

Stop closes the file logger.

Jump to

Keyboard shortcuts

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