theseer/journald

Library to write log entries to Journald

Installs: 7 184

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/theseer/journald

1.1.0 2022-09-27 13:35 UTC

This package is auto-updated.

Last update: 2025-09-24 05:27:43 UTC


README

A simple Library to write to Systemd's Journald from PHP.

use theseer\journald\JournalWriter;
use theseer\journald\JournalEntry;
use theseer\journald\SocketPath;

function sample() {
    throw new RuntimeException('Test Exception Message');
}

try {
    sample();
} catch (Throwable $t) {
    (new JournalWriter(SocketPath::default()))->write(
        JournalEntry::fromThrowable($t)
    );
}

(new JournalWriter(SocketPath::default()))->write(
    JournalEntry::fromMessage('This is a test')
);