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

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

apolinux/logger
===============

Simple logger

v0.6.1(11mo ago)012MITPHPPHP &gt;=7.4

Since Oct 13Pushed 11mo ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (4)Used By (0)

Logger
======

[](#logger)

Register text to file.

Instalation
-----------

[](#instalation)

```
composer require Apolinux/logger

```

### Description

[](#description)

As first step, it must be configured logging parameters with init static method:

```
Logger::init($logname);

```

Then, it's called log method whenever is required.

```
Logger::log('something to log');

...

Logger::log(['phone' => 123 ,'date' => time() ]);

```

### Init method

[](#init-method)

```
Logger::init($filename,
    string $context_format    = self::DEFAULT_CONTEXT_FORMAT,
    string $date_format       = 'c',
    ?string $file_date_format = 'Ymd')

```

$filename: specifies log destination filename

$context\_format : describes format of text. By default is:

{date}|{sid}|{tag}|{context}

Where:

- date : is a date in a format specified by $date\_format. Can be added micro or miliseconds if it's required.
- sid : is a random string generated each time init() is called.
- tag : is a label to describe log used for posterior searches into file.
- context : is the information to write in the log

All the parameters are optional, you can change the format according to your needs.

$date\_format : optional. Format supported by PHP date() function. Describes the format of {date} in context\_format. By default is 'c'.

$file\_date\_format : Optional. Format supported by PHP date() function. Defines the date format in filename, by default is 'Ymd'.

### Log method

[](#log-method)

```
Logger::log($data_log, $tag = self::DEFAULT_TAG);

```

$data\_log : text,array or object to write in file.

$tag : Optional. label to identify the log. By default is 'default'.

Example:

```
require_once 'vendor/autoload.php' ;

use Apolinux\Logger ;

Logger::init(
  'dirlogs/filetosavelogs.log' ,
  '{date}|{sid}|{tag}|{context}' ,
  'YmdHis.u',
  'Ymd'
) ;

...

Logger::log('information to be logged','info') ;

...

Logger::log(['type' => 'human', 'name' => 'Diana'],'register');

```

### TODO

[](#todo)

- use json to format complete line
- encode file to reduce log size
- create log reader
- search in logs

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Every ~297 days

Total

3

Last Release

354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eda0959d683679e20ca43b158749f3995de85cbfd8b03c52f6ff53a3765390b1?d=identicon)[apolinux](/maintainers/apolinux)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/apolinux-logger/health.svg)](https://phpackages.com/packages/apolinux-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)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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