syslog

package
v0.0.0-...-2d8c917 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package syslog provides logging to syslog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender

type Appender struct {
	// Known networks are "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6",
	// "ip", "ip4", "ip6", "unix", "unixgram" and "unixpacket".
	// See tcp.Dial.
	Network  string
	Addr     string
	Facility Facility
	Tag      string
	// contains filtered or unexported fields
}

Appender sends logging to syslog server/daemon. All properties must be set before Start(), otherwise default values will be used.

func NewAppender

func NewAppender() *Appender

NewAppender allocates and returns a new Appender.

func (*Appender) Append

func (a *Appender) Append(event *gol.LoggingEvent)

Append encodes the given logging event and sends to syslog connection.

func (*Appender) Start

func (a *Appender) Start() error

Start connects to syslog server if not connected.

func (*Appender) Stop

func (a *Appender) Stop() error

Stop disconnects current connection.

type Facility

type Facility int

Facility is the syslog facility.

const (
	LOG_KERN Facility = iota
	LOG_USER
	LOG_MAIL
	LOG_DAEMON
	LOG_AUTH
	LOG_SYSLOG
	LOG_LPR
	LOG_NEWS
	LOG_UUCP
	LOG_CRON
	LOG_AUTHPRIV
	LOG_FTP

	LOG_LOCAL0
	LOG_LOCAL1
	LOG_LOCAL2
	LOG_LOCAL3
	LOG_LOCAL4
	LOG_LOCAL5
	LOG_LOCAL6
	LOG_LOCAL7
)

Facility

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL