betterde/logger
Elasticsearch logger handler
32,748
30
| Install | |
|---|---|
composer require betterde/logger |
|
| Latest Version: | v2.2.0 |
| License: | MIT |
| Last Updated: | Apr 11, 2022 |
| Links: | GitHub · Packagist |
Maintainer: GeorgeKing
Laravel log driver for elasticsearch
Installation
$ composer require betterde/logger
$ php artisan vendor:publish --tag=betterde.logger
Config
You can modify config in config/logger.php.
Now we can add the channel of channels in config/logging.php file.
use Betterde\Logger\ElasticsearchLogger;
'channels' => [
'elastic' => [
'driver' => 'custom',
'via' => ElasticsearchLogger::class,
],
],
Add the \Betterde\Logger\Http\Middleware\BulkCollectionLog middleware to App\Http\Kernel.php file.
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
\Betterde\Logger\Http\Middleware\BulkCollectionLog::class
];
Now define the environment variable in .env file like this:
LOG_CHANNEL=elastic
ELASTICSEARCH_HOST=localhost
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_SCHEME=http
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=
Finally, I hope this is helpful.
Sponsors
Related Packages
ytake/laravel-aspect
Aspect Oriented Programming library for laravel framework, and lumen
143,928
138
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| v2.2.0 | ^6.0| | MIT | |
| v2.1.8 | ^6.0| | MIT | |
| 2.1.7 | ^6.0| | MIT | |
| 2.1.6 | ^6.0| | MIT | |
| 2.1.5 | ^6.0| | MIT | |
| 2.1.4 | ^6.0| | MIT | |
| 2.1.3 | ^6.0.0 | MIT | |
| 2.1.2 | ^6.0.0 | MIT | |
| 2.1.1 | ^6.0.0 | MIT | |
| 2.1.0 | ^6.0.0 | MIT | |
| 2.0.0 | ^6.0.0 | MIT | |
| 1.8.7 | ^5.6.0 | MIT | |
| 1.8.6 | ^5.6.0 | MIT | |
| 1.8.5 | ^5.6.0| | MIT | |
| 1.8.4 | ^5.6.0 | MIT | |
| 1.8.3 | ^5.6.0 | MIT | |
| 1.8.2 | ^5.6.0 | MIT | |
| 1.8.1 | ^5.6.0 | MIT | |
| 1.8.0 | ^5.6.0 | MIT | |
| 1.7.0 | >=5.6 | MIT | |
| 1.6.0 | ^6.2 | MIT | |
| 1.5.0 | ^6.2 | MIT | |
| 1.4.0 | ^6.2 | MIT | |
| 1.3.0 | ^6.2 | MIT | |
| 1.2.0 | ^6.2 | MIT | |
| 1.0.2 | ^6.2 | MIT | |
| 1.0.0 | ^6.2 | MIT |