go-systemd: github.com/coreos/go-systemd/journal Index | Files

package journal

import "github.com/coreos/go-systemd/journal"

Package journal provides write bindings to the local systemd journal. It is implemented in pure Go and connects to the journal directly over its unix socket.

To read from the journal, see the "sdjournal" package, which wraps the sd-journal a C API.

http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html

Index

Package Files

journal.go

func Enabled Uses

func Enabled() bool

Enabled returns true if the local systemd journal is available for logging

func Print Uses

func Print(priority Priority, format string, a ...interface{}) error

Print prints a message to the local systemd journal using Send().

func Send Uses

func Send(message string, priority Priority, vars map[string]string) error

Send a message to the local systemd journal. vars is a map of journald fields to values. Fields must be composed of uppercase letters, numbers, and underscores, but must not start with an underscore. Within these restrictions, any arbitrary field name may be used. Some names have special significance: see the journalctl documentation (http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html) for more details. vars may be nil.

type Priority Uses

type Priority int

Priority of a journal message

const (
    PriEmerg Priority = iota
    PriAlert
    PriCrit
    PriErr
    PriWarning
    PriNotice
    PriInfo
    PriDebug
)

Package journal imports 11 packages (graph) and is imported by 297 packages. Updated 2017-03-30. Refresh now. Tools for package owners.