-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
armin nasiri
committed
Oct 13, 2020
1 parent
575c21a
commit 9a611db
Showing
3 changed files
with
44 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# 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) | ||
[![Build Status](https://img.shields.io/travis/map-ir/laravel-log-usage/master.svg?style=flat-square)](https://travis-ci.org/map-ir/laravel-log-usage) | ||
[![Quality Score](https://img.shields.io/scrutinizer/g/map-ir/laravel-log-usage.svg?style=flat-square)](https://scrutinizer-ci.com/g/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 | ||
|
@@ -27,14 +25,16 @@ 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 service provider in bootstrap/app.php. | ||
add package middleware in bootstrap/app.php. | ||
``` php | ||
$app->register(MapIr\LaravelLogUsage\LaravelLogUsageServiceProvider::class); | ||
$app->middleware([ | ||
\MapIr\LaravelLogUsage\Http\Middleware\LogUsageMiddleware::class | ||
]); | ||
``` | ||
copy package config directory `vendor/map-ir/laravel-log-usage/config` to root folder alongside with app directory. | ||
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('laravel-log-usage'); | ||
$app->configure('logUsage'); | ||
``` | ||
> you can set the keys in your .env file | ||
``` dotenv | ||
|
@@ -43,7 +43,7 @@ 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" | ||
KAFKA_KEY="key for kafka producer index" | ||
``` | ||
## Usage | ||
for config ELK Consumer kafka | ||
|
@@ -52,15 +52,6 @@ KAFKA_KEY="key for kafka producer" | |
``` bash | ||
composer test | ||
``` | ||
|
||
### Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details. | ||
|
||
### Security | ||
|
||
If you discover any security related issues, please email [email protected] instead of using the issue tracker. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* Config log usage map-ir | ||
*/ | ||
return [ | ||
"topic" => env("TOPIC","log-usage-undefined"), | ||
|
||
//Kafka Broker server list | ||
"kafka_server" => env("KAFKA_HOST","localhost:9202"), | ||
|
||
//User supplied broker version | ||
"broker_version" => env("BROKER_VERSION","1.0.0"), | ||
|
||
/** | ||
* Topic metadata refresh interval in milliseconds. | ||
* The metadata is automatically refreshed on error and connect. | ||
* Use -1 to disable the intervened refresh | ||
*/ | ||
"metadata_refresh_interval_ms" => env("KAFKA_MRIM",10000), | ||
|
||
/** | ||
*This field indicates how many acknowledgements the leader broker must receive from ISR brokers before responding to the request: | ||
* 0=Broker does not send any response/ack to client, | ||
* 1=Only the leader broker will need to ack the message, | ||
* -1 or all=broker will block until message is committed by all in sync replicas (ISRs) | ||
* or broker's in.sync.replicas setting before sending response. | ||
*/ | ||
"required_ack" => env("REQUIRED_ACK",1), | ||
|
||
//Whether to use asynchronous production messages | ||
"is_async" => env("IS_ASYNC",false), | ||
// key for kafka producer | ||
"key" => env("KAFKA_KEY","Map-ir") | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters