repejota / monolog-nats
A Monolog NATS handler.
0.0.11
2017-10-22 19:14 UTC
Requires
- monolog/monolog: ^1.23
- repejota/nats: ^0.8.5
Requires (Dev)
- cedx/coveralls: ^1.0
- leanphp/phpspec-code-coverage: ^3.1
- phpspec/phpspec: ^3.4
This package is not auto-updated.
Last update: 2024-12-22 05:24:13 UTC
README
Monolog handler for sending logs to NATS (http://nats.io). Useful for async recording those logs on another machine.
Install
composer require repejota/monolog-nats
This will install this package itself Monolog and PHPNAts, if they are not yet installed.
Example
<?php require_once __DIR__.'/../vendor/autoload.php'; use Nats\Connection; use Monolog\Logger; use Monolog\Handler\NatsHandler; $nats = new Connection(); $nats->connect(); $logger = new Logger("monolog-nats-logger"); $natsHandler = new NatsHandler($nats); $logger->pushHandler($natsHandler); $logger->info("Info log");