Categorygithub.com/wercker/journalhook
modulepackage
0.0.0-20230927020745-64542ffa4117
Repository: https://github.com/wercker/journalhook.git
Documentation: pkg.go.dev

# 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{})

# Functions

Adds the Journal hook if journal is enabled Sets log output to ioutil.Discard so stdout isn't captured.

# Structs

No description provided by the author