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
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-15