theseer / journald
用于向 Journald 写入日志条目的库
1.1.0
2022-09-27 13:35 UTC
Requires
- php: ^8.1
- ext-sockets: *
README
一个简单的库,用于从 PHP 向 Systemd 的 Journald 写入。
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') );