PHPackages                             iapotheca/log-processor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. iapotheca/log-processor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

iapotheca/log-processor
=======================

Log Processor for Courier Network

0.0.8(3y ago)0134proprietaryPHP

Since Jul 26Pushed 3y ago2 watchersCompare

[ Source](https://github.com/iapotheca/log-processor)[ Packagist](https://packagist.org/packages/iapotheca/log-processor)[ RSS](/packages/iapotheca-log-processor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (6)Used By (0)

Log Processor
=============

[](#log-processor)

[![Tests](https://github.com/iapotheca/log-processor/actions/workflows/php.yml/badge.svg)](https://github.com/iapotheca/log-processor/actions/workflows/php.yml)

This is a monolog log processor that prepares data intended to go to RabbitMQ to be observed by Logstash ingestion to persist metadata existent in the log message.

This package parses data from the log message into RabbitMQ plain fields. E.g: the following message will be converted to the data structure after:

> Message: `[KEY value] My message here`
>
> Data: `{key: "value", message: "[KEY value] My message here"}`

Installation
------------

[](#installation)

**Step 1**

Install dependencies and this package:

```
composer require php-amqplib/php-amqplib iapotheca/log-processor
```

**Step 2**

Install a RabbitMQ driver into your laravel instance by adding this to your `config/logging`:

```
// ...
use App\Logging\RabbitmqLogger;
//...
    'rabbitmq' => [
        'driver' => 'custom',
        'via' => RabbitmqLogger::class, //  env('LOG_RABBITMQ_EXCHANGE_NAME', 'logs'),
        'host' => env('LOG_RABBITMQ_HOST', 'localhost'),
        'port' => env('LOG_RABBITMQ_PORT', 5672),
        'user' => env('LOG_RABBITMQ_USER', 'guest'),
        'password' => env('LOG_RABBITMQ_PASSWORD', 'password'),
        'log-name' => env('LOG_RABBITMQ_LOG_NAME', 'logstash'),
    ],
//...
```

**Step 3**

Implement your **Custom Logger** where you use this **Processor**:

File: `app/Logging/RabbitmqLogger.php`

```
