syslog

package
v0.0.0-...-e758773 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package syslog provides a simple interface to the system log service. It can send messages to the syslog daemon using UNIX domain sockets, UDP, or TCP connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(p Priority, flag int) *log.Logger

NewLogger provides an object that implements the full log.Logger interface, but sends messages to Syslog instead; flag is passed as is to Logger; priority will be used for all messages sent using this interface. All messages are logged with priority p.

Types

type Priority

type Priority int
const (
	// From /usr/include/sys/syslog.h.
	// These are the same on Linux, BSD, and OS X.
	LOG_EMERG Priority = iota
	LOG_ALERT
	LOG_CRIT
	LOG_ERR
	LOG_WARNING
	LOG_NOTICE
	LOG_INFO
	LOG_DEBUG
)

type Writer

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

A Writer is a connection to a syslog server.

func Dial

func Dial(network, raddr string, priority Priority, prefix string) (w *Writer, err os.Error)

Dial establishes a connection to a log daemon by connecting to address raddr on the network net. Each write to the returned writer sends a log message with the given priority and prefix.

func New

func New(priority Priority, prefix string) (w *Writer, err os.Error)

New establishes a new connection to the system log daemon. Each write to the returned writer sends a log message with the given priority and prefix.

func (*Writer) Close

func (w *Writer) Close() os.Error

func (*Writer) Crit

func (w *Writer) Crit(m string) (err os.Error)

Crit logs a message using the LOG_CRIT priority.

func (*Writer) Debug

func (w *Writer) Debug(m string) (err os.Error)

Debug logs a message using the LOG_DEBUG priority.

func (*Writer) Emerg

func (w *Writer) Emerg(m string) (err os.Error)

Emerg logs a message using the LOG_EMERG priority.

func (*Writer) Err

func (w *Writer) Err(m string) (err os.Error)

ERR logs a message using the LOG_ERR priority.

func (*Writer) Info

func (w *Writer) Info(m string) (err os.Error)

Info logs a message using the LOG_INFO priority.

func (*Writer) Notice

func (w *Writer) Notice(m string) (err os.Error)

Notice logs a message using the LOG_NOTICE priority.

func (*Writer) Warning

func (w *Writer) Warning(m string) (err os.Error)

Warning logs a message using the LOG_WARNING priority.

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, os.Error)

Write sends a log message to the syslog daemon.

Jump to

Keyboard shortcuts

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