Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/map-ir/laravel-log-usage
This package is going to log services requests to kafka
https://github.com/map-ir/laravel-log-usage
Last synced: about 2 months ago
JSON representation
This package is going to log services requests to kafka
- Host: GitHub
- URL: https://github.com/map-ir/laravel-log-usage
- Owner: map-ir
- License: mit
- Created: 2020-10-10T06:20:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T08:22:43.000Z (about 1 year ago)
- Last Synced: 2024-09-17T09:54:42.863Z (4 months ago)
- Language: PHP
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Map.ir log usage kafka and ELK
[![Latest Version on Packagist](https://img.shields.io/packagist/v/map-ir/laravel-log-usage.svg?style=flat-square)](https://packagist.org/packages/map-ir/laravel-log-usage)
[![Total Downloads](https://img.shields.io/packagist/dt/map-ir/laravel-log-usage.svg?style=flat-square)](https://packagist.org/packages/map-ir/laravel-log-usage)#### kafka
#### elasticSearch
#### logstash
## InstallationYou can install the package via composer:
```bash
composer require map-ir/laravel-log-usage
```
## laravel Installation
in laravel < 5.4
add this line to your config/app.php providers:
``` php
MapIr\LaravelLogUsage\LaravelLogUsageServiceProvider::class,
```
after install package in laravel run artisan for publish config file
```bash
php artisan vendor:publish --tag=config
```
After publish the package files you must open laravel-log-usage.php in config folder.## lumen Installation:
add package middleware in bootstrap/app.php.
``` php
$app->middleware([
\MapIr\LaravelLogUsage\Http\Middleware\LogUsageMiddleware::class
]);
```
copy package config directory `vendor/map-ir/laravel-log-usage/config/logUsage.php` to root folder alongside with app directory.
update bootstrap/app.php by adding this line in `Register Config Files` section:
``` php
$app->configure('logUsage');
```
> you can set the keys in your .env file
``` dotenv
TOPIC="topic name for produce kafka"
BROKER_VERSION="version use broker"
KAFKA_MRIM="Topic metadata refresh interval in milliseconds broker"
REQUIRED_ACK="This field indicates how many acknowledgements the leader broker"
IS_ASYNC="Whether to use asynchronous production messages"
KAFKA_KEY="key for kafka producer index"
```
## Usage
for config ELK Consumer kafka
### Testing``` bash
composer test
```
### SecurityIf you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Armin Nasiri](https://github.com/map-ir)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.