Open atc0005 opened 5 years ago
https://github.com/go-kit/kit/blob/master/log/README.md
provides a minimal interface for structured logging in services. It may be wrapped to encode conventions, enforce type-safety, provide leveled logging, and so on. It can be used for both typical application log events, and log-structured data streams.
I didn't see syslog support mentioned, but I've not dug very far into the feature list.
EDIT: Looks like syslog support is included?
https://github.com/RackSec/srslog
The repo is marked read-only; presumably the project has been abandoned?
Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger.
You can add hooks for logging levels. For example to send errors to an exception tracking service on Error, Fatal and Panic, info to StatsD or log to multiple places simultaneously, e.g. syslog.
If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). Just assign empty string to the first two parameters of NewSyslogHook. It should look like the following.
import ( "log/syslog" "github.com/sirupsen/logrus" lSyslog "github.com/sirupsen/logrus/hooks/syslog" ) func main() { log := logrus.New() hook, err := lSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "") if err == nil { log.Hooks.Add(hook) } }
https://github.com/golang/glog
Used by Minikube (FWTW)
Hasn't been touched since July 2015
Background
According to the Go developers, they have no plans to further develop the
log/syslog
package:Need to do some additional research and determine which logging packages are approachable to a newbie like myself, but still offer enough flexibility to work with the systems that I interact with on a routine basis.
Preferences
Packages that I explore and use will ideally have support for these features: