PHPackages                             hugsbrugs/php-log - 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. hugsbrugs/php-log

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

hugsbrugs/php-log
=================

PHP Log Utilities

06PHP

Since Apr 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hugsbrugs/php-log)[ Packagist](https://packagist.org/packages/hugsbrugs/php-log)[ RSS](/packages/hugsbrugs-php-log/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-log
=======

[](#php-log)

This librairy provides utilities function for simple file logging support.

[![Build Status](https://camo.githubusercontent.com/af3220a6643aaadb32bf009b984fda0692d90961d2d3334aef8176b96ab3af5d/68747470733a2f2f7472617669732d63692e6f72672f6875677362727567732f7068702d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hugsbrugs/php-log)[![Coverage Status](https://camo.githubusercontent.com/fbd62aac7e11d9a29b2378e1796756474ebf4abf6f6e9d9c41000cce39444182/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6875677362727567732f7068702d6c6f672f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/hugsbrugs/php-log?branch=master)

Install
-------

[](#install)

Install package with composer

```
composer require hugsbrugs/php-log

```

In your PHP code, load library

```
require_once __DIR__ . '/../vendor/autoload.php';
use Hug\Log\Log as Log;
```

Usage
-----

[](#usage)

Writes the values of certain variables (time, remote\_addr, request\_uri) along with a message in a log file.

```
Log::write_log($message, $logfile = null);
```

If $logfile is not defined then you have to define a constant DEFAULT\_LOG with path to default log file

Transforms a PHP integer error code into a human readable PHP constant

```
$log_message = Log::decode_log_level($error_code);
```

Unit Tests
----------

[](#unit-tests)

```
phpunit --bootstrap vendor/autoload.php tests

```

Author
------

[](#author)

Hugo Maugey [visit my website ;)](https://hugo.maugey.fr)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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.

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

logphp

### Embed Badge

![Health badge](/badges/hugsbrugs-php-log/health.svg)

```
[![Health](https://phpackages.com/badges/hugsbrugs-php-log/health.svg)](https://phpackages.com/packages/hugsbrugs-php-log)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B10.9k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1938.5M263](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M317](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)

PHPackages © 2026

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