Logy|Docs

Overview

Send log records to console, file, syslog, or custom destinations

Handlers receive log records and write them somewhere. Logy includes built-in handlers for common destinations and an interface for custom destinations.

Most applications start with console output. Add file output when a local log file is required. Add syslog when the runtime environment expects syslog records. Register a custom handler when logs need to go to an internal pipeline or audit sink.

main.go
err := logy.LoadConfig(&logy.Config{
	Handlers: logy.Handlers{"console"},
	Console: &logy.ConsoleConfig{
		Enabled: true,
	},
})
if err != nil {
	panic(err)
}

Continue with Console handler, File handler, Syslog handler, or Custom handlers.