PHPackages                             zozlak/logging - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zozlak/logging

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zozlak/logging
==============

Set of methods to deal with the HTTP Accept header

1.2.0(1y ago)111.8k↑614.3%11MITPHPPHP &gt;=8.0CI failing

Since Jul 30Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/zozlak/logging)[ Packagist](https://packagist.org/packages/zozlak/logging)[ Docs](https://github.com/zozlak/logging)[ RSS](/packages/zozlak-logging/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (4)Versions (7)Used By (11)

[![Latest Stable Version](https://camo.githubusercontent.com/98c7a6f52a512524247cd382553f16eaeb11f2eba6a060114080392333d8306c/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7a6c616b2f6c6f6767696e672f762f737461626c65)](https://packagist.org/packages/zozlak/logging)[![Build Status](https://camo.githubusercontent.com/0dcf27791aab9ad212d23eba9e6788a7f41a8eca5b14da3c5e79cab62cfba57e/68747470733a2f2f7472617669732d63692e6f72672f7a6f7a6c616b2f6c6f6767696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zozlak/logging)[![Coverage Status](https://camo.githubusercontent.com/ef44ce0e0940124e18c7d3eb647b272433871c1961f7826a988d685f7f79b5f9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a6f7a6c616b2f6c6f6767696e672f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zozlak/logging?branch=master)[![License](https://camo.githubusercontent.com/dea881bb1b7ef6cd7fd2b2cb8b0036c589259901fd5c90a25b46c06c4d8e81ef/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7a6c616b2f6c6f6767696e672f6c6963656e7365)](https://packagist.org/packages/zozlak/logging)

Logging
=======

[](#logging)

A simple file-based PSR-3 logging library.

- provides basic severity level filtering
- can be used as a singleton
    - also with multiple logs
- able to serialize arrays and objects (first tries with `__toString()`, then applies `json_encode()`)
- supports placeholders (see PSR-3)
- compatible with all PSR-3 releases from 1 on

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

[](#installation)

`composer require zozlak/logging`

Usage
-----

[](#usage)

```
// simplest possible logging
$log = new \zozlak\logging\Log('log_file');
$log->info('message');

// logging to standard out/err
$log = new \zozlak\logging\Log('php://stdout');
$log->info('message');
$log = new \zozlak\logging\Log('php://stderr');
$log->info('message');

// logging to already opened file
$logFile = tmpfile();
$log = new \zozlak\logging\Log($logFile);
$log->info('message');

// message formatting and filtering
$log = new \zozlak\logging\Log('log_file', \Psr\Log\LogLevel::INFO, "{LEVEL}:{TIMESTAMP}:{FILE}:{LINE}:{MESSAGE}");
$log->info('message');
$log->debug('skipped message');

// singleton example
$log = new \zozlak\logging\Log('log_file');
\zozlak\logging\Logger::addLog($log);
\zozlak\logging\Logger::info('message');

// singleton with multiple logs
$logAll = new \zozlak\logging\Log('log_all');
$logErrors = new \zozlak\logging\Log('log_errors', \Psr\Log\LogLevel::ERROR);
\zozlak\logging\Logger::addLog($logAll, 'all');
\zozlak\logging\Logger::addLog($logErrors, 'error');

\zozlak\logging\Logger::info('message1', [], 'all');
\zozlak\logging\Logger::error('message2', [], 'error');
\zozlak\logging\Logger::error('message3'); // written to the 'error' log

\zozlak\logging\Logger::setDefaultLog('all');
\zozlak\logging\Logger::error('message4'); // written to the 'all' log
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance59

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~393 days

Recently: every ~491 days

Total

6

Last Release

563d ago

Major Versions

0.1.1 → 1.0.02023-03-23

PHP version history (2 changes)0.1.0PHP &gt;=7.0

1.0.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zozlak-logging/health.svg)

```
[![Health](https://phpackages.com/badges/zozlak-logging/health.svg)](https://phpackages.com/packages/zozlak-logging)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514139.2M689](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k51](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

368116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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