journalhook

package module
v0.0.0-...-b2fa3ad Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 7 Imported by: 0

README

journalhook

systemd-journald hook for logrus

wercker status

Use

import "github.com/wercker/journalhook"

journalhook.Enable()

Note that this will discard all journal output. Generally when logging to the journal, your application will be managed by systemd, which will automatically capture command output and send it to the journal. This way we preempt that potential log message duplication.

If you'd like not to do that, it's as easy as:


import (
    "github.com/wercker/journalhook"
    "github.com/sirupsen/logrus"
)

logrus.AddHook(&journalhook.JournalHook{})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable()

Types

type JournalHook

type JournalHook struct{}

func (*JournalHook) Fire

func (hook *JournalHook) Fire(entry *logrus.Entry) error

func (*JournalHook) Levels

func (hook *JournalHook) Levels() []logrus.Level

`Levels()` returns a slice of `Levels` the hook is fired for.

Jump to

Keyboard shortcuts

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