PHPackages                             baohan/monolog - 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. baohan/monolog

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

baohan/monolog
==============

A configured monolog for out-of-box

1.0.3(6y ago)0117[2 issues](https://github.com/baohanddd/baohan-monolog/issues)[2 PRs](https://github.com/baohanddd/baohan-monolog/pulls)MITPHPPHP ^7.3

Since Jan 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/baohanddd/baohan-monolog)[ Packagist](https://packagist.org/packages/baohan/monolog)[ RSS](/packages/baohan-monolog/feed)WikiDiscussions master Synced 5d ago

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

A configured Monolog for out-of-box
===================================

[](#a-configured-monolog-for-out-of-box)

Monolog is a powerful logger, but need some configures before to use for each projects, even if there are almost same config items. So it provides simplest way to reduce these works, that's why the project born.

### Installation

[](#installation)

```
$ composer require "baohan/monolog: 1.*"

```

### Example

[](#example)

```
use Baohan\Monolog\Logger\AppLogger;
use Monolog\Logger;

require('./vendor/autoload.php');

$extra = [
    'key1' => 'val1'
];
$log = AppLogger::getLogger('demo', $extra);
// or grab http request data as extra
// $extra = AppLogger::getExtraFromRequest($request);
// AppLogger::setExtra($log, $extra);
$log->pushHandler(AppLogger::getConsoleHandler(Logger::DEBUG));
$log->pushHandler(AppLogger::getStreamHandler('debug.log', Logger::DEBUG));
$log->pushHandler(AppLogger::getStreamHandler('error.log', Logger::ERROR));
$log->pushHandler(AppLogger::getBearychatHandler('YOUR_API_KEY', Logger::CRITICAL));

$context = [
    'page' => 'demo.php'
];
$log->debug('The first debug message', $context);
```

It will output:

```
$ php demo.php
> [2020-01-02T07:30:02.602905+00:00] demo.DEBUG: The first debug message {"page":"demo.php"} {"key1":"val1"}

```

That's all.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

2

Last Release

2326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79f2348c437cf1a1aae2848beacc1adc2cae3d8be7faacbe28d5a3483225a367?d=identicon)[baohanddd](/maintainers/baohanddd)

---

Top Contributors

[![baohanddd](https://avatars.githubusercontent.com/u/3166072?v=4)](https://github.com/baohanddd "baohanddd (6 commits)")

### Embed Badge

![Health badge](/badges/baohan-monolog/health.svg)

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

###  Alternatives

[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)

PHPackages © 2026

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