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

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

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

bluebik/logger

Composer 安装命令:

composer require bluebik/logger

包简介

Log seperate folder by level build on monolog/monolog

README 文档

README

Log seperate folder by level build on monolog/monolog

Installation

$ composer require bluebik/logger

Usage

use Bluebik\Logger\LoggerFactory;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    protected $logger;

    public function __construct()
    {
        $this->logger = LoggerFactory::create('action');
    }

    public function index()
    {
        $this->logger->action(__METHOD__, "start");
        ...
    }
}

Components

There are 3 components including

  • Bluebik\Logger\Commands\LogBackup - Command for backup and archive log daily
  • Bluebik\Logger\Middleware\AccessLogMiddleware - Middleware to handle access log
  • Bluebik\Logger\Traits\CommandLogger - Trait for creating logger of command class

Log Backup Configuration

Edit in app\Console\Kernel.php

protected $commands = [
    \Bluebik\Logger\Commands\LogBackup::class,
    ...
];


protected function schedule(Schedule $schedule) {
    $schedule->command('log:backup')->daily();
    ...
}

AccessLogMiddleware Configuration

Edit in app\Http\Kernel.php

protected $middleware = [
    \Bluebik\Logger\Middleware\AccessLogMiddleware::class,
    ...
];

CommandLogger Usage

use Bluebik\Logger\Traits\CommandLogger;

class CommandClass extends Command {
    use CommandLogger;

    public function handle()
    {
        $this->logger->action(__METHOD__, "start");
        ...
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固