Native Go output to the systemd journal socket.
Go to file
Laurence Withers df6107a67e Added log/slog adapter package 2026-01-18 13:47:50 +00:00
journslog Added log/slog adapter package 2026-01-18 13:47:50 +00:00
testsink Add testsink package, and unit tests for Conn / entries 2026-01-18 12:49:53 +00:00
LICENSE Initial working version 2024-02-18 10:31:14 +00:00
README.md Added log/slog adapter package 2026-01-18 13:47:50 +00:00
attr.go Initial working version 2024-02-18 10:31:14 +00:00
attr_key.go Initial working version 2024-02-18 10:31:14 +00:00
attr_key_test.go Initial working version 2024-02-18 10:31:14 +00:00
attr_test.go Initial working version 2024-02-18 10:31:14 +00:00
conn.go Add Conn.Close 2026-01-18 12:48:46 +00:00
conn_test.go Add testsink package, and unit tests for Conn / entries 2026-01-18 12:49:53 +00:00
global.go Add GetGlobalConn 2026-01-18 12:48:32 +00:00
go.mod Update to Go 1.25, fix go vet errors 2026-01-15 09:47:42 +00:00
priority.go Initial working version 2024-02-18 10:31:14 +00:00
wire_proto.go Pre-size net.Buffers 2024-02-18 14:44:20 +00:00
wire_proto_test.go Initial working version 2024-02-18 10:31:14 +00:00

README.md

journal

Native Go output to the systemd journal socket. See package journslog for a log/slog adapter.

Quick start:

import "src.lwithers.me.uk/go/journal"

func main() {
    journal.Entry(journal.PriInfo, "hello, world", nil)
}

The log/slog adapter:

import (
    "log/slog"

    "src.lwithers.me.uk/go/journal/journslog"
)

func main() {
    h, err := journslog.NewHandler()
    if err != nil {
        panic(err)
    }
    slog.SetDefault(slog.New(h))
    slog.Info("hello, world", "attr", "value")
}