cusodede/yii2-log-filetarget 问题修复 & 功能扩展

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

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

cusodede/yii2-log-filetarget

最新稳定版本:1.0.0

Composer 安装命令:

composer require cusodede/yii2-log-filetarget

包简介

Extended Yii2 Log FileTarget

README 文档

README

Some useful helpers for Yii2 framework

GitHub Workflow Status

Installation

The preferred way to install this extension is through composer.

Run

php composer.phar require cusodede/yii2-log-filetarget "^1.0.0"

or add

"cusodede/yii2-log-filetarget": "^1.0.0"

to the require section of your composer.json file.

Requirements

PHP >= 8.0

Usage

This log target is totally like default Yii2 file target, but it can accept function as the logFile parameter.

[
	'components' => [
		'log' => [
			'targets' => [
				[
					'class' => cusodede\log\FileTarget\FileTarget::class,
					'logFile' => fn():string => '@app/runtime/logs/'.date('YmdH').'/ot-'.date('YmdHi').'.log',
				]
			],
		],
		...
];

Note that log file name will be generated, when Yii logger is flushed (see \yii\log\Logger::flush()), and not when message is logged.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2022-08-28