Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/repejota/monolog-nats

A Monolog NATS handler.
https://github.com/repejota/monolog-nats

handler log message monolog nats php

Last synced: about 5 hours ago
JSON representation

A Monolog NATS handler.

Awesome Lists containing this project

README

        

# Monolog NATS

Monolog handler for sending logs to NATS (http://nats.io). Useful for async recording those logs on another machine.

* Develop [![CircleCI](https://circleci.com/gh/repejota/monolog-nats/tree/develop.svg?style=svg)](https://circleci.com/gh/repejota/monolog-nats/tree/develop)
* Master [![CircleCI](https://circleci.com/gh/repejota/monolog-nats/tree/master.svg?style=svg)](https://circleci.com/gh/repejota/monolog-nats/tree/master)

* Coverage [![Coverage Status](https://coveralls.io/repos/github/repejota/monolog-nats/badge.svg)](https://coveralls.io/github/repejota/monolog-nats)

## Install

```bash
composer require repejota/monolog-nats
```

This will install this package itself [Monolog](https://packagist.org/packages/monolog/monolog)
and [PHPNAts](https://github.com/repejota/phpnats), if they are not yet installed.

## Example

```php
connect();

$logger = new Logger("monolog-nats-logger");
$natsHandler = new NatsHandler($nats);
$logger->pushHandler($natsHandler);

$logger->info("Info log");

```