PHPackages                             apollo11/file-logger - 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. apollo11/file-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

apollo11/file-logger
====================

Log any errors in file

v2.0.2(5y ago)33771[2 issues](https://github.com/apolloeleven/file-logger/issues)Apache-2.0PHPPHP &gt;=5.6

Since Apr 2Pushed 5y ago7 watchersCompare

[ Source](https://github.com/apolloeleven/file-logger)[ Packagist](https://packagist.org/packages/apollo11/file-logger)[ RSS](/packages/apollo11-file-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (9)Used By (0)

File-logger
===========

[](#file-logger)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist apollo11/file-logger "*"

```

or add

```
"apollo11/file-logger": "*"

```

to the require section of your `composer.json` file.

Basic usage
-----------

[](#basic-usage)

```
include_once 'FileColor.php';
include_once 'FileLogger.php';

$logger = new \apollo11\fileLogger\FileLogger([
    'logFilePath' => dirname(__FILE__) . '/logs',
    'logFileName' => 'test12.log',
    'logFileDateFormat' => "Y_m_d_H_i_s",
    'logFileTemplate' => '{date}_{fileName}',
    'logTextDateFormat' => 'Y-m-d',
    'logTextTemplate' => '{date} [{type}] - {message}' . PHP_EOL,
]);

for ($i = 0; $i < 20; $i++){
    $logger->log("My test $i", \apollo11\fileLogger\FileColor::F_WHITE, \apollo11\fileLogger\FileColor::B_GREEN);
}
```

Logger Options
--------------

[](#logger-options)

##### Log file creation types (const)

[](#log-file-creation-types-const)

```
FILE_CREATE_TYPE_BY_TIME     //recreate log file by time
FILE_CREATE_TYPE_BY_SIZE    //recreate log file by size

```

##### Color

[](#color)

```
enableColors       //colored text for logs , deafult value true

```

##### Save latest logs

[](#save-latest-logs)

```
saveLatestFileNumber       // bool/integer , deafult value 100 (will save only last 100 log files)

```

##### Force create Directory

[](#force-create-directory)

```
//Force create directory if it does not exist
//Throws error if directory path was invalid

forceCreateDirectory   // bool default value false

```

##### Log file recreation type

[](#log-file-recreation-type)

```
fileCreateType     //log file creation type  , default value   "FILE_CREATE_TYPE_BY_TIME"

```

##### Log file recreation days

[](#log-file-recreation-days)

```
Add  this properties if file recreation type set to   "FILE_CREATE_TYPE_BY_TIME"

fileReCreateDays        //  (integer)

```

##### Log file recreation size

[](#log-file-recreation-size)

```
Add this property if file recreation type set to   "FILE_CREATE_TYPE_BY_SIZE"

filReCreateSize = 900; //size in bytes

```

##### Log file attributes

[](#log-file-attributes)

```
logFilePath             // full path to log file
logFileName             // log file name   "example.log"
logFileDateFormat       // log file date format default value   "Y_m_d"
logFileTemplate         // log file template deafault value   "{date}_{fileName}"

```

##### Log text attributes

[](#log-text-attributes)

```
logTextDateFormat       // log text date format default value   "Y-m-d H:i:s"
logTextTemplate         // log text template default value   "[ {date} | {type} ] - {message} " . PHP_EOL

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 65.7% 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

Every ~158 days

Recently: every ~231 days

Total

8

Last Release

1859d ago

Major Versions

v0.0.2 → V1.0.02018-10-04

v1.1.0 → v2.0.02021-04-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47417401?v=4)[Zura Sekhniashvili](/maintainers/arboshiki)[@arboshiki](https://github.com/arboshiki)

---

Top Contributors

[![sleemy1997](https://avatars.githubusercontent.com/u/36790954?v=4)](https://github.com/sleemy1997 "sleemy1997 (23 commits)")[![keshikashviligio](https://avatars.githubusercontent.com/u/6962834?v=4)](https://github.com/keshikashviligio "keshikashviligio (6 commits)")[![thecodeholic](https://avatars.githubusercontent.com/u/4627922?v=4)](https://github.com/thecodeholic "thecodeholic (6 commits)")

### Embed Badge

![Health badge](/badges/apollo11-file-logger/health.svg)

```
[![Health](https://phpackages.com/badges/apollo11-file-logger/health.svg)](https://phpackages.com/packages/apollo11-file-logger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

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