定制 officegest/api-logger 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

officegest/api-logger

最新稳定版本:1.3.1

Composer 安装命令:

composer require officegest/api-logger

包简介

Monitoring and log your APIs

README 文档

README

This is a laravel package to save logs from api.

Installation

composer require officegest/api-logger

Publish the config file for this package. This will add the file config/officegest-api-logger-config.php, where you can configure this package.

$ php artisan vendor:publish --tag=officegest-api-logger-config

You need add this variables to your .env

API_LOGGER_ELASTIC_HOST="your_elastic_url:port"
API_LOGGER_ELASTIC_LOGS_INDEX="your_index_name"

## Optional
#API_LOGGER_ELASTIC_USERNAME="your_user"
#API_LOGGER_ELASTIC_PASSWORD="your_password"

Usage

Add middleware alias to $middlewareAliases

//app/Http/Kernel.php (l10)
'logger' => \OfficegestApiLogger\Middlewares\OfficegestApiLoggerMiddleware::class,

Add middleware at routes you want log to elasticsearch

/*
|--------------------------------------------------------------------------
| Example add middleware to group of endpoints
|--------------------------------------------------------------------------
*/
Route::middleware('logger')->controller(YourController::class)
    ->name('yourname.')
    ->prefix('yourprefix')
    ->group(function () {
        ...
    });

Security

If you discover any security related issues, please email suporte@guisoft.net or use issues of this repo.

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-07