logspout: github.com/gliderlabs/logspout/adapters/syslog Index | Files

package syslog

import "github.com/gliderlabs/logspout/adapters/syslog"


Package Files



const (
    // Rfc5424Format is the modern syslog protocol format. https://tools.ietf.org/html/rfc5424
    Rfc5424Format Format = "rfc5424"
    // Rfc3164Format is the legacy BSD syslog protocol format. https://tools.ietf.org/html/rfc3164
    Rfc3164Format Format = "rfc3164"

    // TraditionalTCPFraming is the traditional LF framing of syslog messages on the wire
    TraditionalTCPFraming TCPFraming = "traditional"
    // OctetCountedTCPFraming prepends the size of each message before the message. https://tools.ietf.org/html/rfc6587#section-3.4.1
    OctetCountedTCPFraming TCPFraming = "octet-counted"

func NewSyslogAdapter Uses

func NewSyslogAdapter(route *router.Route) (router.LogAdapter, error)

NewSyslogAdapter returnas a configured syslog.Adapter

type Adapter Uses

type Adapter struct {
    // contains filtered or unexported fields

Adapter streams log output to a connection in the Syslog format

func (*Adapter) Stream Uses

func (a *Adapter) Stream(logstream chan *router.Message)

Stream sends log data to a connection

type FieldTemplates Uses

type FieldTemplates struct {
    // contains filtered or unexported fields

FieldTemplates for rendering Syslog messages

type Format Uses

type Format string

Format represents the RFC spec to use for syslog messages

type Message Uses

type Message struct {

Message extends router.Message for the syslog standard

func (*Message) ContainerName Uses

func (m *Message) ContainerName() string

ContainerName returns the message's container name

func (*Message) ContainerNameSplitN Uses

func (m *Message) ContainerNameSplitN(sep string, n int) []string

ContainerNameSplitN returns the message's container name sliced at most "n" times using "sep"

func (*Message) Hostname Uses

func (m *Message) Hostname() string

Hostname returns the os hostname

func (*Message) Priority Uses

func (m *Message) Priority() syslog.Priority

Priority returns a syslog.Priority based on the message source

func (*Message) Render Uses

func (m *Message) Render(format Format, tmpl *FieldTemplates) ([]byte, error)

Render transforms the log message using the Syslog template

func (*Message) Timestamp Uses

func (m *Message) Timestamp() string

Timestamp returns the message's syslog formatted timestamp

type TCPFraming Uses

type TCPFraming string

TCPFraming represents the type of framing to use for syslog messages

Package syslog imports 16 packages (graph) and is imported by 79 packages. Updated 2020-05-22. Refresh now. Tools for package owners.