Documentation
¶
Overview ¶
Package logbuf captures the panel's own log output into an in-memory ring buffer and fans new lines out to live subscribers (the dashboard log viewer). It implements io.Writer so it can be installed as a tee on the standard logger — every log.Printf across the app is then both written to stderr (for journald) and made available to the panel UI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Default = New()
Default is the process-wide hub the standard logger tees into.
Functions ¶
func Location ¶ added in v0.13.0
Location returns the log timezone, defaulting to server-local until one is set.
func SetLocation ¶ added in v0.13.0
SetLocation sets the timezone used for log timestamps.
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub keeps a ring of recent log lines and broadcasts new ones to subscribers.
type RotatingFile ¶
type RotatingFile struct {
// contains filtered or unexported fields
}
RotatingFile is a size-based rotating log writer (an io.Writer). When the active file would exceed MaxBytes, it is renamed to "<path>.1" (shifting any older backups up by one, dropping the oldest beyond MaxBackups) and a fresh file is opened. It is safe for concurrent writes.
func NewRotatingFile ¶
func NewRotatingFile(path string, maxBytes int64, maxBackups int) (*RotatingFile, error)
NewRotatingFile opens (creating the directory if needed) a rotating log file at path, rolling over at maxBytes and keeping maxBackups rotated files.