bbrist/laravel-console-logger 问题修复 & 功能扩展

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

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

bbrist/laravel-console-logger

Composer 安装命令:

composer require bbrist/laravel-console-logger

包简介

Log to console during artisan commands

README 文档

README

The laravel-console-logger package is a helper package designed to allow for more in-depth console logging

By default, adding this package to your project will automatically (via the ServiceProvider) start diverting logs (i.e. Log::info() statements) to console output. The log level that is output can be changed using the verbosity flags for the Artisan console (i.e. -v, -vv, -vvv, -q).

With the default configuration, -q will output nothing, no verbosity args will output error and higher, -v will output warning and higher, -vv will output info and higher, and -vvv will output all logs to console.

The config/logging.php configuration can be used to alter the default configuration. By default, notice, error, critical, alert, and emergency levels are logged to the laravel.log file in addition to the console (even if -q is specified). To add/remove levels to include in the laravel.log file, just set/modify the console.logMethods value in the config/logging.php file.

To log all logs to file, regardless of whether they are logged to console, you can set/modify the console.logToFile value to true in the config/logging.php file.

Force Log to File

The Log::logToFile() method will force any following logs to log to laravel.log. You can explicitly set this status to true or false by providing the value as a parameter (i.e. Log::logToFile(false)).

This can be useful when you want to ensure that a chunk of code is logged to laravel.log regardless of where/how it's executed (dependent on the value of env('LOG_LEVEL')).

For example:

public function mymethod() {

    Log::logToFile(true);   // enable force log-to-file
    
    ... 
    
    Log::info("some message");  // This will always be logged to file (dependent on the LOG_LEVEL ENV value)
    
    ... 
    
    Log::logToFile(false);  // disable force log-to-file

}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固