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

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

consolidation/log
=================

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

3.1.1(6mo ago)15462.2M—2.5%67MITPHPPHP &gt;=8.0.0CI passing

Since Mar 5Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/consolidation/log)[ Packagist](https://packagist.org/packages/consolidation/log)[ RSS](/packages/consolidation-log/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelogDependencies (5)Versions (53)Used By (7)

Consolidation\\Log
==================

[](#consolidationlog)

Improved [PSR-3](http://www.php-fig.org/psr/psr-3/) [Psr\\Log](https://github.com/php-fig/log) logger based on Symfony Console components.

[![ci](https://github.com/consolidation/log/workflows/CI/badge.svg)](https://travis-ci.org/consolidation/log)[![scrutinizer](https://camo.githubusercontent.com/0d70e4d29a3591b8b39c8306e189503012fa273dfdc74febc70699d47e47fa9b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6e736f6c69646174696f6e2f6c6f672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/consolidation/log/?branch=master)[![codecov](https://camo.githubusercontent.com/8edac9926a8d4785d94c05b7f9bab3b491ed6d6e760de9e6cfaf4b3b1b6385d9/68747470733a2f2f636f6465636f762e696f2f67682f636f6e736f6c69646174696f6e2f6c6f672f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d43416142376f66687878)](https://codecov.io/gh/consolidation/log)[![license](https://camo.githubusercontent.com/afee83bec9e6f5289f6ff591d2babc709f06ca41ff50edf6edbc9fe60fba69c7/68747470733a2f2f706f7365722e707567782e6f72672f636f6e736f6c69646174696f6e2f6c6f672f6c6963656e7365)](https://packagist.org/packages/consolidation/log)

Component Status
----------------

[](#component-status)

In use in [Robo](https://github.com/Codegyre/Robo).

Motivation
----------

[](#motivation)

Consolidation\\Log provides a PSR-3 compatible logger that provides styled log output to the standard error (stderr) stream. By default, styling is provided by the SymfonyStyle class from the Symfony Console component; however, alternative stylers may be provided if desired.

Usage
-----

[](#usage)

```
$logger = new \Consolidation\Log\Logger($output);
$logger->setLogOutputStyler(new LogOutputStyler()); // optional
$logger->warning('The file {name} does not exist.', ['name' => $filename]);

```

String interpolation -- that is, the substitution of replacements, such as `{name}` in the example above, is not required by PSR-3, and is not implemented by default in the Psr\\Log project. However, it is recommended by PRS-3, and is often done, e.g. in the Symfony Console logger.

Consolidation\\Log supports string interpolation.

A logger manager can be used to delegate all log messages to one or more loggers.

```
$logger = new \Consolidation\Log\LoggerManager();
$logger->add('default', new \Consolidation\Log\Logger($output));

```

This is useful if, for example, you need to inject a logger into application objects early (e.g. into a dependency injection container), but the output object to log to will not be available until later.

Comparison to Existing Solutions
--------------------------------

[](#comparison-to-existing-solutions)

Many Symfony Console compoenents use SymfonyStyle to format their output messages. This helper class has methods named things like `success` and `warning`, making it seem like a natural choice for reporting status.

However, in practice it is much more convenient to use an actual Psr-3 logger for logging. Doing this allows a Symfony Console component to call an external library that may not need to depend on Symfony Style. Having the Psr\\Log\\LoggerInterface serve as the only shared IO-related interface in common between the console tool and the libraries it depends on promots loose coupling, allowing said libraries to be re-used in other contexts which may wish to log in different ways.

Symfony Console provides the ConsoleLogger to fill this need; however, ConsoleLogger does not provide any facility for styling output, leaving SymfonyStyle as the preferred logging mechanism for style-conscienscious console coders.

Consolidation\\Log provides the benefits of both classes, allowing for code that both behaved technically correctly (redirecting to stderr) without sacrificing on style.

Monolog also provides a full-featured Console logger that might be applicable for some use cases.

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance80

Actively maintained with recent releases

Popularity66

Solid adoption and visibility

Community24

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 92.1% 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 ~141 days

Recently: every ~330 days

Total

26

Last Release

185d ago

Major Versions

0.1.3 → 1.0.02016-03-20

1.x-dev → 2.0.02020-02-07

2.x-dev → 3.0.02022-04-05

PHP version history (5 changes)0.1.0PHP &gt;=5.4.0

1.0.3PHP &gt;=5.5.0

1.1.0PHP &gt;=5.4.5

2.0.1PHP &gt;=7.1.3

3.0.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b34cc6bd882277b6c6dda19bf6631ae5c3a909fd667c826a15121642cdc051b2?d=identicon)[greg.1.anderson](/maintainers/greg.1.anderson)

---

Top Contributors

[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (70 commits)")[![andypost](https://avatars.githubusercontent.com/u/73713?v=4)](https://github.com/andypost "andypost (1 commits)")[![alexpott](https://avatars.githubusercontent.com/u/769634?v=4)](https://github.com/alexpott "alexpott (1 commits)")[![Jeroeny](https://avatars.githubusercontent.com/u/1517978?v=4)](https://github.com/Jeroeny "Jeroeny (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![weitzman](https://avatars.githubusercontent.com/u/7740?v=4)](https://github.com/weitzman "weitzman (1 commits)")[![GuilhermeHideki](https://avatars.githubusercontent.com/u/9982971?v=4)](https://github.com/GuilhermeHideki "GuilhermeHideki (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[open-telemetry/api

API for OpenTelemetry PHP.

1933.0M214](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2322.9M248](/packages/open-telemetry-sdk)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)

PHPackages © 2026

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