PHPackages                             ibsciss/supermonolog-service-provider - 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. ibsciss/supermonolog-service-provider

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

ibsciss/supermonolog-service-provider
=====================================

An extended monolog service provider for silex framework. Add crossFinger &amp; log rotation handlers as options.

v2.0.3(12y ago)38.2k2[2 issues](https://github.com/Ibsciss/supermonolog-service-provider/issues)MITPHP

Since Feb 5Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Ibsciss/supermonolog-service-provider)[ Packagist](https://packagist.org/packages/ibsciss/supermonolog-service-provider)[ RSS](/packages/ibsciss-supermonolog-service-provider/feed)WikiDiscussions master Synced yesterday

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

supermonolog-service-provider
=============================

[](#supermonolog-service-provider)

An extended **monolog** service provider for **Silex framework**

[![Build Status](https://camo.githubusercontent.com/33eb8474f16626a3c4a07877b2897ec6dc8666aa82c2c34604117875f7b0bf77/68747470733a2f2f7472617669732d63692e6f72672f496273636973732f73757065726d6f6e6f6c6f672d736572766963652d70726f76696465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Ibsciss/supermonolog-service-provider) [![Coverage Status](https://camo.githubusercontent.com/cbd7a1982a9fc30fc5da09e367508f350743b3894117477f4015093f110c731f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f496273636973732f73757065726d6f6e6f6c6f672d736572766963652d70726f76696465722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/Ibsciss/supermonolog-service-provider?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/efc826782d1048e1666446c2bd124a85da132f3242118fe650d7123d74f0789c/68747470733a2f2f706f7365722e707567782e6f72672f696273636973732f73757065726d6f6e6f6c6f672d736572766963652d70726f76696465722f762f737461626c652e706e67)](https://packagist.org/packages/ibsciss/supermonolog-service-provider) [![Latest Unstable Version](https://camo.githubusercontent.com/376ad4ccb3f1b4d0862fd502d097e27400816cfbc893442992f8b43d0f69c3e0/68747470733a2f2f706f7365722e707567782e6f72672f696273636973732f73757065726d6f6e6f6c6f672d736572766963652d70726f76696465722f762f756e737461626c652e706e67)](https://packagist.org/packages/ibsciss/supermonolog-service-provider) [![License](https://camo.githubusercontent.com/744e84ee9f38370fc3de92d67aa0000d7e3a45d71d4493d96835252d26db4f50/68747470733a2f2f706f7365722e707567782e6f72672f696273636973732f73757065726d6f6e6f6c6f672d736572766963652d70726f76696465722f6c6963656e73652e706e67)](https://packagist.org/packages/ibsciss/supermonolog-service-provider)

Why a **Super**MonologService ?
-------------------------------

[](#why-a-supermonologservice-)

The silex built-in `MonologServiceProvider` use only a few of the monolog habilities, and don't allow advanced configuration.

This **SuperMonologService** is more extensible and provide two new logs strategies in the silex core :

- A `FingersCrossed` strategy
- A `RotatingFile` strategy

By default only the *FingersCrossed* strategy is activated, but you can use the strategies together or only once at time.

### What is FingerCrossed strategy ?

[](#what-is-fingercrossed-strategy-)

As described in the [Monolog documentation](https://github.com/Seldaek/monolog) :

> **FingersCrossedHandler:** A very interesting wrapper. It takes a logger as parameter and will accumulate log records of all levels until a record exceeds the defined severity level. At which point it delivers all records, including those of lower severity, to the handler it wraps. This means that until an error actually happens you will not see anything in your logs, but when it happens you will have the full information, including debug and info records. This provides you with all the information you need, but only when you need it.

### What is RotatingFile strategy ?

[](#what-is-rotatingfile-strategy-)

Like before, the Monolog documentation give us the answer :

> **RotatingFileHandler:** Logs records to a file and creates one logfile per day. It will also delete files older than `maxfiles`. You should use logrotate for high profile setups though, this is just meant as a quick and dirty solution.

How to install it ?
-------------------

[](#how-to-install-it-)

1. Add `"Ibsciss/supermonolog-service-provider": "dev-master"` in the require section of your `composer.json` file and run the `composer update` command.
2. Register the service with the silex register method `$app->register(new SuperMonologServiceProvider())` (don't forget the use `\Ibsciss\Silex\Provider\SuperMonologServiceProvider` statement).

Basic use
---------

[](#basic-use)

SuperMonolog extends the original `monolog` service (and the associated `logger` service) by overriding the `monolog.handler` service to push is own strategy on it. So you can use your `$app['monolog']` service as before.

So you have to setup the `ServiceProvide` as if it was the built-in `monolog` service: you have to define where the log will stored by the application with the `monolog.logfile` attribute ([read full built-in provider doc](http://silex.sensiolabs.org/doc/providers/monolog.html)).

```
$app->register(new Silex\Provider\MonologServiceProvider(), array(
    'monolog.logfile' => __DIR__.'/development.log',
));
```

After the `SuperMonologService` registration, only the `FingersCrossed` strategy is activated (and only in production mode).

In debug mode (`$app['debug'] = true;`) the service provide a basic `StreamHandler`.

**Note : by default a JsonFormatter is used to generate log**

*You can disable the `FingersCrossed` strategy with the `monolog.fingerscrossed` attribute set to `false` and come back to the `StreamHandler` used by the default `MonologServiceProvider`.*

FingersCrossedHandler options
-----------------------------

[](#fingerscrossedhandler-options)

With SuperMonologService, the default handler use a FingersCrossed strategy to handle logs, its provide the following options :

- `monolog.fingerscrossed` a boolean value enabling the fingerscrossed strategy (default: **true**)
- `monolog.fingerscrossed.handler` the internal handler used by the fingerscrossed strategy to send logs (default: **StreamHandler**)
- `monolog.fingerscrossed.level` the severity level wich the logs are printed to the defined handler, accept :
    - `Monolog\Logger::DEBUG`
    - `Monolog\Logger::INFO`
    - `Monolog\Logger::NOTICE` (default level)
    - `Monolog\Logger::WARNING`
    - `Monolog\Logger::ERROR`
    - `Monolog\Logger::CRITICAL`
    - `Monolog\Logger::ALERT`
    - `Monolog\Logger::EMERGENCY`

*Note : the `monolog.level` is still available and used to define from wich logging level the logs are handled. For example if you define the `monolog.level` to `INFO` and the `monolog.fingerscrossed.level` to `WARNING`, all log from the INFO severity level are sended if a WARNING event occur*

RotatingFile strategy
---------------------

[](#rotatingfile-strategy)

You can enable `RotatingFileHandler` by setting the `monolog.rotatingfile` attribute to `true`.

*By default the FingersCrossedHanfler` is remains active and the RotatingFileHandler is used as an internal handler called by the FingersCrossedHandler to send logs.*

If the `monolog.fingerscrossed` is set to `false` and the `monolog.rotatingfile` to `true` the default handler became a `RotatingFile` one.

The rotatingFile strategy define the following options :

- `monolog.rotatingfile` a boolean value enabling the rotating file strategy (default: `false`)
- `monolog.rotatingfile.maxfiles` an integer value, set the maximum files keep by the rotating handler.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

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

Total

8

Last Release

4473d ago

Major Versions

v1.0.3 → v2.0.02014-02-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/499e3e54d4bef172ed65ffeb52b7b044177ac73a7075dd559792dead496c6807?d=identicon)[lilobase](/maintainers/lilobase)

---

Top Contributors

[![lilobase](https://avatars.githubusercontent.com/u/335501?v=4)](https://github.com/lilobase "lilobase (21 commits)")

---

Tags

logservice providersilexmonologlogrotatecrossfinger

### Embed Badge

![Health badge](/badges/ibsciss-supermonolog-service-provider/health.svg)

```
[![Health](https://phpackages.com/badges/ibsciss-supermonolog-service-provider/health.svg)](https://phpackages.com/packages/ibsciss-supermonolog-service-provider)
```

###  Alternatives

[theorchard/monolog-cascade

Monolog extension to configure multiple loggers in the blink of an eye and access them from anywhere

1482.2M9](/packages/theorchard-monolog-cascade)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[inpsyde/logzio-monolog

Logz.io integration for Monolog

191.2M1](/packages/inpsyde-logzio-monolog)[mero/yii2-monolog

The Monolog integration for the Yii framework.

42186.1k](/packages/mero-yii2-monolog)[mero/telegram-handler

Monolog handler to send log by Telegram

36113.3k](/packages/mero-telegram-handler)

PHPackages © 2026

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