itt/logger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

itt/logger

最新稳定版本:0.3

Composer 安装命令:

composer require 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=

统计信息

  • 总下载量: 99
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-04