sherifai/clearcut 问题修复 & 功能扩展

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

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

sherifai/clearcut

最新稳定版本:2.0.0

Composer 安装命令:

composer require sherifai/clearcut

包简介

Laravel package for logging Http request/response in the database

README 文档

README

Laravel package for logging Http requests/responses to database. It provides a middleware that handles request logging and sets a header "X-Request-Id" with a uuid for tracking each request. All logging is done in the background so it won't affect response time.

Features

  • Handles Request Logging to Database as a background job
  • Provides a UUID for each request for tracking/debugging
  • Dumps log table to laravel storage periodically
  • Configurable to match or exclude certain requests

Installation

Require the sherifai/clearcut package in your composer.json and update your dependencies:

$ composer require sherifai/clearcut

Next publish the configuration. This is an optional step, it contains some configurations that by default logs all requests.

$ php artisan vendor:publish

Next generate the migration file:

$ php artisan clearcut:migration

It will generate the <timestamp>_request_logs_table.php migration.

Usage

To Start logging requests add LogRequests Middleware in Kernel.php

protected $middleware = [
    // ...
    \SherifAI\ClearCut\Middleware\LogRequests::class,
];

Clearcut then pushes the logging process to a background job.

Configuration

The configuration file config/clearcut.php conatins values for selectively logging requests. By default ClearCut Logs all requests. The most important configurations however are

  1. 'dump_every' => 1000 which specifies the interval for logging requests before dumping the database.

  2. 'storage_disk' => 'local' which specifies the storage location for the dump file

  3. 'queue_name' => 'clearcut' which is the default queue for processing log job

  4. 'enabled' => true which determines of the package is working and storing request logs

Contribution

Support follows PSR-2 PHP coding standards.

Please report any issue you find in the issues page. Pull requests are welcome.

License

Released under the MIT License, see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-02