https://github.com/theseer/journald
A simple Library to write to Systemd's Journald from PHP.
https://github.com/theseer/journald
Last synced: over 1 year ago
JSON representation
A simple Library to write to Systemd's Journald from PHP.
- Host: GitHub
- URL: https://github.com/theseer/journald
- Owner: theseer
- License: bsd-3-clause
- Created: 2022-05-02T23:20:22.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-24T01:00:43.000Z (over 2 years ago)
- Last Synced: 2024-05-09T09:12:32.423Z (about 2 years ago)
- Language: PHP
- Size: 79.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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')
);
```