PHPackages                             microparts/logs-php - 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. microparts/logs-php

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

microparts/logs-php
===================

Simple pre-configured Monolog wrapper. Without fucking brackets.

1.0.3(7y ago)16762MITPHP

Since Apr 30Pushed 6y ago2 watchersCompare

[ Source](https://github.com/microparts/logs-php)[ Packagist](https://packagist.org/packages/microparts/logs-php)[ RSS](/packages/microparts-logs-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (2)

Simple pre-configured Monolog wrapper
-------------------------------------

[](#simple-pre-configured-monolog-wrapper)

[![CircleCI](https://camo.githubusercontent.com/36a88b03ee080b2000ae476c5c2e635b0091bc391affb7c0dd2c871bd5470cc6/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6963726f70617274732f6c6f67732d7068702e7376673f7374796c653d737667)](https://circleci.com/gh/microparts/logs-php)[![codecov](https://camo.githubusercontent.com/658831d226355ae7861e4b584160ba0a42d272483b964992f0dc7f4d4729c096/68747470733a2f2f636f6465636f762e696f2f67682f6d6963726f70617274732f6c6f67732d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/microparts/logs-php)

**THIS PACKAGE PERMANENTLY MOVED TO: **

---

I create this library with one target, — I'm sick of always copies and paste same code to any of my microservices with logs.

This wrapper solves one problem with logs. And it name, — fucking brackets -&gt; \[\] \[\] \[\] \[\].

Example, how this wrapper present the logs:

```
[2019-04-29 21:39:52] Server.INFO: CONFIG_PATH = ./configuration
[2019-04-29 21:39:52] Server.INFO: STAGE = local
[2019-04-29 21:39:52] Server.INFO: Configuration module loaded
[2019-04-29 21:39:52] Server.INFO: HTTP static server started at 0.0.0.0:8080

```

This is a normal view and without fucking brackets of Monolog's. Okay, I'm hate it too, how it use?

Usage
-----

[](#usage)

1. Install library through `composer`:

```
composer require microparts/logs-php
```

1. Basic example for most cases will do like as:

```
use Microparts\Logger\Logger;

$log = Logger::default(); // Psr\Log\LoggerInterface
$log->info('write something');
```

2. If you want register this library thought Service Provider (add to application DI container), see this example:

```
// this code uses Igni framework with Laravel DI container.
use Igni\Application\Providers\ServiceProvider;
use Monolog\Logger;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

class LoggerModule implements ServiceProvider
{
    /**
     * @param \Illuminate\Container\Container|ContainerInterface $container
     */
    public function provideServices($container): void
    {
        $container->singleton(LoggerInterface::class, function () {
            return Logger::default(); // it's all!
        });
    }
}
```

3. How to register logger without static:: method? It also very simple.

```
use Microparts\Logger\Logger;
use Psr\Log\LogLevel;

$log = new Logger('Haku', LogLevel::DEBUG); // enabled debug mode and set the channel name
$log->addErrorLogHandler();
$log->register();

$log->getMonolog()->info('Let\'s fly!');
```

4. Okay. It's cool. But I have write logs to multiple streams. How I do it?

```
use Microparts\Logger\Logger;
use Monolog\Handler\HandlerInterface;
use Monolog\Handler\NullHandler;
use Psr\Log\LogLevel;

$log = new Logger('Sen', LogLevel::DEBUG); // enabled debug mode and set the channel name
$log->addErrorLogHandler();
$log->addHandler(function (string $level): HandlerInterface {
    return new NullHandler($level);
});

$log->register();

$log->getMonolog()->info('Diligence is the mother of success');
```

Simple? Yes. And without fucking brackets.

Tests
-----

[](#tests)

- Coverage 100%. I'm say truth. Maybe.
- `vendor/bin/phpunit`

License
-------

[](#license)

The MIT License

Copyright © 2019 teamc.io, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

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

Total

4

Last Release

2555d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35d8eff4a3e66b58f3e2af56fe948035469de1e19ac29c532d65c681955bbd18?d=identicon)[Roquie](/maintainers/Roquie)

---

Top Contributors

[![roquie](https://avatars.githubusercontent.com/u/3214290?v=4)](https://github.com/roquie "roquie (17 commits)")

---

Tags

bracketslogsmonologphpphp7psr

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/microparts-logs-php/health.svg)

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

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k189.7M258](/packages/symfony-monolog-bridge)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2382.6k](/packages/graycore-magento2-stdlogging)

PHPackages © 2026

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