import "github.com/vmware/vic/pkg/log/syslog"
dialer.go formatter.go hook.go syslog.go syslog_unix.go writer.go
Logger is the logger object used by the package
MakeTag returns prfeix + sep + proc if prefix is not empty. If proc is empty, proc is set to filepath.Base(os.Args[0]). If prefix is empty, MakeTag returns proc.
Format is the syslog format, e.g. RFC 3164
type Hook struct {
// contains filtered or unexported fields
}
Priority is a combination of the syslog facility and severity. For example, Alert | Ftp sends an alert severity message from the FTP facility. The default severity is Emerg; the default facility is Kern.
const ( // From /usr/include/sys/syslog.h. // These are the same on Linux, BSD, and OS X. Emerg Priority = iota // LOG_EMERG Alert // LOG_ALERT Crit // LOG_CRIT Err // LOG_ERR Warning // LOG_WARNING Notice // LOG_NOTICE Info // LOG_INFO Debug // LOG_DEBUG )
const ( // From /usr/include/sys/syslog.h. // These are the same up to LOG_FTP on Linux, BSD, and OS X. Kern Priority = iota << 3 // LOG_KERN User // LOG_USER Mail // LOG_MAIL Daemon // LOG_DAEMON Auth // LOG_AUTH Syslog // LOG_SYSLOG Lpr // LOG_LPR News // LOG_NEWS Uucp // LOG_UUCP Cron // LOG_CRON Authpriv // LOG_AUTHPRIV Ftp // LOG_FTP Local0 // LOG_LOCAL0 Local1 // LOG_LOCAL1 Local2 // LOG_LOCAL2 Local3 // LOG_LOCAL3 Local4 // LOG_LOCAL4 Local5 // LOG_LOCAL5 Local6 // LOG_LOCAL6 Local7 // LOG_LOCAL7 )
type Writer interface { io.WriteCloser Emerg(string) error Crit(string) error Err(string) error Warning(string) error Info(string) error Debug(string) error WithTag(tag string) Writer WithPriority(priority Priority) Writer }
Dial establishes a connection to a log daemon by connecting to address raddr on the specified network. Each write to the returned writer sends a log message with the given facility, severity and tag. If network is empty, Dial will connect to the local syslog server.
New establishes a new connection to the system log daemon. Each write to the returned writer sends a log message with the given priority and prefix.
Package syslog imports 10 packages (graph) and is imported by 8 packages. Updated 2017-08-21. Refresh now. Tools for package owners.