Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gilbitron/laravel-queue-monitor

A Laravel package to monitor queue jobs
https://github.com/gilbitron/laravel-queue-monitor

Last synced: 30 days ago
JSON representation

A Laravel package to monitor queue jobs

Awesome Lists containing this project

README

        

# Laravel Queue Monitor

A Laravel package to monitor queue jobs. Logs certain information about [queue jobs](https://laravel.com/docs/5.3/queues) in a database table:

* The elapsed time of the job including start and finish timestamps
* If `--tries` is being used the attempt number for each job
* If the job failed and the exception given (if available)
* Custom data (optional)

## Requirements

* Laravel 5.3+

## Install

Install the composer package:

```php
composer require gilbitron/laravel-queue-monitor
```

Add the service provider in `config/app.php`:

```php
/*
* Package Service Providers...
*/
Gilbitron\LaravelQueueMonitor\LaravelQueueMonitorProvider::class,
```

Run a migration to setup the `queue_monitor` database table:

```php
php artisan migrate
```

## Usage

All queue jobs will now be monitored and results stored to the `queue_monitor` database table. No other configuration is required.

### Custom Data

To save custom data with the queue monitor results you need to include the `QueueMonitorData` trait in your Job and use the `saveQueueMonitorData()` method. For example:

```php
results = rand(1, 100);

$this->saveQueueMonitorData([
'results' => $this->results,
]);

// ...
}
}
```

## Credits

Laravel Queue Monitor was created by [Gilbert Pellegrom](https://gilbert.pellegrom.me) from
[Dev7studios](https://dev7studios.co). Released under the MIT license.