syslog

package
v0.0.0-...-cae5287 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package syslog provides an io.Writer for a syslog server and WriteMessageFunctions which produce RFC5424 (https://tools.ietf.org/html/rfc5424) compliant logmessages

Index

Constants

View Source
const DEBUG = 7
View Source
const ERROR = 3
View Source
const INFO = 6
View Source
const WARN = 4

Variables

This section is empty.

Functions

func NewWriteHeaderFunc

func NewWriteHeaderFunc(appname string, severity int) func(ctx context.Context, buf []byte, message string) []byte

NewWriteHeaderFunc returns a function which writes a syslog compliant header to a buffer. Note: The header is terminated with a space

For example

w := syslog.NewWriteHeaderFunc("myapp", syslog.INFO)

assigns an Info writer to w.

func NewWriter

func NewWriter(endpoint string) (io.Writer, error)

NewWriter creates a new syslogwriter which writes to the given endpoint

For example

syslog.NewWriter (localhost:514)

writes to local syslog server listening on port 514

Types

This section is empty.

Jump to

Keyboard shortcuts

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