dalee / monolog-syslog3164
Monolog handler for syslog3164
Installs: 1 673
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.6.0
- monolog/monolog: ^1.23
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2025-01-17 04:12:21 UTC
README
Getting started
$ composer require dalee/monolog-syslog3164
Example
use Monolog\Logger; use Dalee\Monolog\Handler\Syslog3164Handler; $logger = new Logger('main'); $handler = new Syslog3164Handler('127.0.0.1', 9010, Syslog3164Handler::FACILITY_UUCP); $handler->setTag('switchman')->setHostname('app.local'); $logger->pushHandler($handler); $logger->debug('Error occurred', [ 'system' => 'customer-service', 'kind' => 'error', 'payload' => [ 'code' => 5194, 'message' => 'Error sending report' ] ]);
By default Syslog3164Handler
is constructed with 127.0.0.1:514
, debug level and bubbling. The default facility is user
.
The output for above is:
<15>Oct 4 23:10:59 app.local php: Error occurred {"system":"customer-service","kind":"error","payload":{"code":5194,"message":"Error sending report"}}
Notices
According to RFC3164, the total length of the packet must be 1024 or less. In most cases that's not what you want so
it's disabled by default but you can use setStrictSize
to turn it on.
The code consists of a single really simple file so there is no separated documentation.