承接 xraffsarr/php-logger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

xraffsarr/php-logger

Composer 安装命令:

composer require xraffsarr/php-logger

包简介

A simple PHP logger

README 文档

README

GitHub release GitHub license GitHub top language Packagist PHP Version Support GitHub issues Packagist Downloads GitHub code size in bytes

A php logger based on psr/log interface.

Installation

The package can be installed via Composer:

composer require xraffsarr/php-logger

Configuration

FOr usage via Facade pattern within the project, you only need to indicate the path to save the log

use PhpLogger\Facade\Log;

Log::setLogPath('[pathToSave]');

Replacing pathToSave with the desired path.

You can configure the type of log and the method to. If you want the logs to be saved in JSON format, you can set the JSON writer with.

use PhpLogger\Facade\Log;
use PhpLogger\LoggerType;

Log::setLogType(LoggerType::JSON_WRITER);

In that case the resulting file log.json, will contain an array of JSON objects in the format:

{
    "date_time": "19\/02\/2022 14:47:50",
    "level": "emergency",
    "message": "Test debug logger Facade",
    "context": {
        "user": {
            "name": "Mario",
            "surname": "Rossi"
        },
        "data": [
            "a",
            "b",
            {
                "t": "a",
                "a": "b"
            }
        ]
    }
}

Usage

The Logger can be used via Facade or instantiating a logger with its own configurations.

Via Facade

You can use the logger via Facade, simply by invoking the desired methods related to the type of log.

use PhpLogger\Facade\Log;

Log::debug('Debug log', [
    'data' => [
        ...
    ]
]);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固