PHPackages                             cusodede/yii2-log-filetarget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. cusodede/yii2-log-filetarget

ActiveYii2-extension[Logging &amp; Monitoring](/categories/logging)

cusodede/yii2-log-filetarget
============================

Extended Yii2 Log FileTarget

1.0.0(3y ago)011GPL-3.0-or-laterPHPPHP &gt;=8.0

Since Aug 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cusodede/yii2-log-filetarget)[ Packagist](https://packagist.org/packages/cusodede/yii2-log-filetarget)[ RSS](/packages/cusodede-yii2-log-filetarget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

yii2-helpers
============

[](#yii2-helpers)

Some useful helpers for Yii2 framework

[![GitHub Workflow Status](https://camo.githubusercontent.com/2f0fd2525e17cb8e7a233b8c0b585a8f67e3ca6e0944cfd7b300707e1559fb7f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6375736f646564652f796969322d6c6f672d66696c657461726765742f434925323077697468253230506f737467726553514c)](https://camo.githubusercontent.com/2f0fd2525e17cb8e7a233b8c0b585a8f67e3ca6e0944cfd7b300707e1559fb7f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6375736f646564652f796969322d6c6f672d66696c657461726765742f434925323077697468253230506f737467726553514c)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

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
------------

[](#requirements)

PHP &gt;= 8.0

Usage
-----

[](#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.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76ddc43524bb32eb36568e25b6ae283bc25bb51a4572789997909092145af0f5?d=identicon)[pozitronik](/maintainers/pozitronik)

---

Top Contributors

[![pozitronik](https://avatars.githubusercontent.com/u/2357892?v=4)](https://github.com/pozitronik "pozitronik (4 commits)")

---

Tags

logFileTarget

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cusodede-yii2-log-filetarget/health.svg)

```
[![Health](https://phpackages.com/badges/cusodede-yii2-log-filetarget/health.svg)](https://phpackages.com/packages/cusodede-yii2-log-filetarget)
```

###  Alternatives

[samdark/yii2-psr-log-target

Yii 2 log target which uses PSR-3 compatible logger

841.8M10](/packages/samdark-yii2-psr-log-target)[index0h/yii2-log

Many Yii2 log targets

49204.5k](/packages/index0h-yii2-log)[mero/yii2-monolog

The Monolog integration for the Yii framework.

42186.1k](/packages/mero-yii2-monolog)[putyourlightson/craft-log-to-file

Logs messages to a specific log file for Craft CMS.

29368.0k5](/packages/putyourlightson-craft-log-to-file)[baibaratsky/yii2-rollbar

Rollbar for Yii2

35130.5k](/packages/baibaratsky-yii2-rollbar)[lav45/yii2-activity-logger

Tools to store user activity log for Yii2

3456.3k](/packages/lav45-yii2-activity-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
