定制 tyrellsys/cakephp-log 二次开发

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

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

tyrellsys/cakephp-log

Composer 安装命令:

composer require tyrellsys/cakephp-log

包简介

CakePHPLog plugin for CakePHP

README 文档

README

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require tyrellsys/cakephp-log

Usage

Formatter::getMessage($message)

convert $message to string.

[hostname]:/path/to/filename(line no)[pid]: extracted $message
...
use Tyrellsys\CakePHPLog\Formatter;
...
    $message = string / array / Cake\Datasource\EntityInterface / Object

    Log::write(LOG_WARNING, Formatter::getMessage($message));
    Log::info(Formatter::getMessage($message));
    $this->log(Formatter::getMessage($message), LOG_WARNING);

Override CakePHP4 Cake\Log\Log and Cake\Log\LogTrait

https://book.cakephp.org/4/en/appendices/4-0-migration-guide.html#log

Logging related methods like Cake\Log\LogTrait::log(), Cake\Log\Log::write() etc. now only accept string for $message argument. This change was necessary to align the API with PSR-3 standard.

You understand and use the feature to ignore the change.

Tyrellsys\CakePHP\Log

...
use Tyrellsys\CakePHPLog\Log;
...
        Log::write(LOG_WARNING, $mixed); // mixed message with Tyrellsys/CakePHPLog/Formatter::getMessage()
...

Tyrellsys\CakePHPLog\LogTrait

...
use Tyrellsys\CakePHPLog\LogTrait;
...
class XXX
{
    use Tyrellsys\CakePHPLog/LogTrait;
...
        $this->log($mixed, LOG_WARNING); // mixed message with Tyrellsys/CakePHPLog/Formatter::getMessage()
...
}
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固