Documentation ¶
Overview ¶
Copy-paste from standard syslog to set correct format for our log parser
Index ¶
- func NewLogger(p Priority, logFlag int) (*log.Logger, error)
- type Priority
- type Writer
- func (w *Writer) Alert(m string) error
- func (w *Writer) Close() error
- func (w *Writer) Crit(m string) error
- func (w *Writer) Debug(m string) error
- func (w *Writer) Emerg(m string) error
- func (w *Writer) Err(m string) error
- func (w *Writer) Info(m string) error
- func (w *Writer) Notice(m string) error
- func (w *Writer) Warning(m string) error
- func (w *Writer) Write(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Priority ¶
type Priority int
The Priority is a combination of the syslog facility and severity. For example, LOG_ALERT | LOG_FTP sends an alert severity message from the FTP facility. The default severity is LOG_EMERG; the default facility is LOG_KERN.
const ( // From /usr/include/sys/syslog.h. // These are the same up to LOG_FTP on Linux, BSD, and OS X. LOG_KERN Priority = iota << 3 // nolint LOG_USER // nolint LOG_MAIL // nolint LOG_DAEMON // nolint LOG_AUTH // nolint LOG_SYSLOG // nolint LOG_LPR // nolint LOG_NEWS // nolint LOG_UUCP // nolint LOG_CRON // nolint LOG_AUTHPRIV // nolint LOG_FTP // nolint LOG_LOCAL0 // nolint LOG_LOCAL1 // nolint LOG_LOCAL2 // nolint LOG_LOCAL3 // nolint LOG_LOCAL4 // nolint LOG_LOCAL5 // nolint LOG_LOCAL6 // nolint LOG_LOCAL7 // nolint )
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 raddr on the specified network. Each write to the returned writer sends a log message with the facility and severity (from priority) and tag. If tag is empty, the os.Args[0] is used. If network is empty, Dial will connect to the local syslog server. Otherwise, see the documentation for net.Dial for valid values of network and raddr.
func New ¶
New establishes a new connection to the system log daemon. Each write to the returned writer sends a log message with the given priority (a combination of the syslog facility and severity) and prefix tag. If tag is empty, the os.Args[0] is used.
func (*Writer) Alert ¶
Alert logs a message with severity LOG_ALERT, ignoring the severity passed to New.
func (*Writer) Crit ¶
Crit logs a message with severity LOG_CRIT, ignoring the severity passed to New.
func (*Writer) Debug ¶
Debug logs a message with severity LOG_DEBUG, ignoring the severity passed to New.
func (*Writer) Emerg ¶
Emerg logs a message with severity LOG_EMERG, ignoring the severity passed to New.
func (*Writer) Info ¶
Info logs a message with severity LOG_INFO, ignoring the severity passed to New.
func (*Writer) Notice ¶
Notice logs a message with severity LOG_NOTICE, ignoring the severity passed to New.