Documentation ¶
Overview ¶
Package syslog implements a syslog writer over UDP and TCP following RFC5424, RFC5426 and RFC6587. It is designed to serve as an access log writer for gorouter and is therefore not general purpose.
Index ¶
Constants ¶
View Source
const ByteOrderMark = "\ufeff"
ByteOrderMark as required by RFC5424
Variables ¶
View Source
var ( ErrInvalidNetwork = fmt.Errorf("syslog: invalid network") ErrInvalidPriority = fmt.Errorf("syslog: invalid priority") )
Functions ¶
This section is empty.
Types ¶
type Priority ¶
type Priority int
The Priority is a combination of the syslog facility and severity. For example, SeverityAlert | FacilityFtp sends an alert severity message from the FTP facility. The default severity is SeverityEmerg; the default facility is FacilityKern.
const ( // From /usr/include/sys/syslog.h. // These are the same up to LOG_FTP on Linux, BSD, and OS X. FacilityKern Priority = iota << 3 FacilityUser FacilityMail FacilityDaemon FacilityAuth FacilitySyslog FacilityLpr FacilityNews FacilityUucp FacilityCron FacilityAuthPriv FacilityFtp FacilityLocal0 FacilityLocal1 FacilityLocal2 FacilityLocal3 FacilityLocal4 FacilityLocal5 FacilityLocal6 FacilityLocal7 )
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
A Writer is a connection to a syslog server.
func Dial ¶
Dial establishes a connection to a log daemon by connecting to address addr on the specified network.
Click to show internal directories.
Click to hide internal directories.