zap-syslog: github.com/imperfectgo/zap-syslog Index | Files | Directories

package zapsyslog

import "github.com/imperfectgo/zap-syslog"

Index

Package Files

encoder.go syncer.go

func NewSyslogEncoder Uses

func NewSyslogEncoder(cfg SyslogEncoderConfig) zapcore.Encoder

NewSyslogEncoder creates a syslogEncoder.

type ConnSyncer Uses

type ConnSyncer struct {
    // contains filtered or unexported fields
}

ConnSyncer describes connection sink for syslog.

func NewConnSyncer Uses

func NewConnSyncer(network, raddr string) (*ConnSyncer, error)

NewConnSyncer returns a new conn sink for syslog.

func (*ConnSyncer) Sync Uses

func (s *ConnSyncer) Sync() error

Sync implements zapcore.WriteSyncer interface.

func (*ConnSyncer) Write Uses

func (s *ConnSyncer) Write(p []byte) (n int, err error)

Write writes to syslog with retry.

type Framing Uses

type Framing int

Framing configures RFC6587 TCP transport framing.

const (
    NonTransparentFraming Framing = iota
    OctetCountingFraming
    DefaultFraming = NonTransparentFraming
)

Framing.

type SyslogEncoderConfig Uses

type SyslogEncoderConfig struct {
    zapcore.EncoderConfig

    Framing  Framing         `json:"framing" yaml:"framing"`
    Facility syslog.Priority `json:"facility" yaml:"facility"`
    Hostname string          `json:"hostname" yaml:"hostname"`
    PID      int             `json:"pid" yaml:"pid"`
    App      string          `json:"app" yaml:"app"`
}

SyslogEncoderConfig allows users to configure the concrete encoders for zap syslog.

Directories

PathSynopsis
example
internal
internal/bufferpoolPackage bufferpool houses zap's shared internal buffer pool.
syslog

Package zapsyslog imports 11 packages (graph) and is imported by 2 packages. Updated 2018-04-19. Refresh now. Tools for package owners.