定制 teachiq/laravel-command-logger 二次开发

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

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

teachiq/laravel-command-logger

Composer 安装命令:

composer require teachiq/laravel-command-logger

包简介

Log commands with their execution time

README 文档

README

We are no longer using this package in favor of https://github.com/spatie/laravel-schedule-monitor and Oh Dear (https://ohdear.app/).

Log commands with their execution time

Latest Version on Packagist

Log the start and finish of all commands, along with their execution time. This is especially useful to detect if scheduled commands (for instance every night) run for longer than expected.

Installation

You can install the package via composer:

composer require teachiq/laravel-command-logger

Usage

The package auto-registers. The log is saved by default to storage/logs/command.log.

[2020-06-07 10:30:14] environment.DEBUG: Starting route:list at 2020-06-07 10:30:14  
[2020-06-07 10:30:14] environment.DEBUG: Finished route:list at 2020-06-07 10:30:14 (0.34346413612366 seconds)  
[2020-06-07 10:36:25] environment.DEBUG: Starting exam:move-teacher at 2020-06-09 07:36:25  
[2020-06-07 10:36:25] environment.DEBUG: __SLOW__ Finished exam:move-teacher at 2020-06-09 07:36:25 (18.763263940811 seconds)  

You can configure the pagage by overriding the values in config/command-log.php if you want. The default values are the following:

<?php

return [
    // The log channel where the logs are written
    'channel' => [
        'driver' => 'single',
        'path' => storage_path('logs/command.log'),
        'level' => 'debug',
    ],
    // Specify any specific commands that should be excluded from logging
    'exclude' => [
        'config:cache',
        'route:cache',
    ],
    // Exeuctions longer than this value (in seconds) will be marked with __SLOW__ in the log
    'slow' => 5,
];

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email martin.krisell@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固