emiliosh/itt-logger
最新稳定版本:0.4
Composer 安装命令:
composer require emiliosh/itt-logger
包简介
Opensearch logger handler
关键字:
README 文档
README
This is a fork of https://github.com/betterde/logger but uses https://opensearch.org/docs/1.2/clients/php/ as a client
Installation
$ composer require itt/logger $ php artisan vendor:publish --tag=itt.logger
Config
You can modify config in config/ittlogger.php.
Now we can add the channel of channels in config/logging.php file.
use Itt\Logger\OpensearchLogger; 'channels' => [ 'opensearch' => [ 'driver' => 'custom', 'via' => OpensearchLogger::class, ], ],
Add the \Itt\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, \Itt\Logger\Http\Middleware\BulkCollectionLog::class ];
Now define the environment variable in .env file like this:
LOG_CHANNEL=opensearch
OPENSEARCH_HOST=localhost
OPENSEARCH_PORT=9200
OPENSEARCH_SCHEME=http
OPENSEARCH_USER=
OPENSEARCH_PASS=
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-26