Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/theseer/journald

A simple Library to write to Systemd's Journald from PHP.
https://github.com/theseer/journald

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# Journald

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

```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')
);

```