PHPackages                             lexik/monolog-browser-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. lexik/monolog-browser-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

lexik/monolog-browser-bundle
============================

This Symfony2 bundle provides a Doctrine DBAL handler for Monolog and a web UI to display log entries

v1.0.2(9y ago)6257.8k17[3 PRs](https://github.com/lexik/LexikMonologBrowserBundle/pulls)MITPHPPHP &gt;=5.3.2

Since May 25Pushed 6y ago15 watchersCompare

[ Source](https://github.com/lexik/LexikMonologBrowserBundle)[ Packagist](https://packagist.org/packages/lexik/monolog-browser-bundle)[ Docs](https://github.com/lexik/LexikMonologBrowserBundle)[ RSS](/packages/lexik-monolog-browser-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (7)Used By (0)

LexikMonologBrowserBundle
=========================

[](#lexikmonologbrowserbundle)

[![Build Status](https://camo.githubusercontent.com/1c4e7bce924a657bd139039c76f60b95cfca298f44752729bfb0d9d187f95613/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6c6578696b2f4c6578696b4d6f6e6f6c6f6742726f7773657242756e646c652e706e67)](http://travis-ci.org/lexik/LexikMonologBrowserBundle)[![Latest Stable Version](https://camo.githubusercontent.com/951b5cf2f4a47153169c2daeb1c3fddb945462498f9c366a2cfa6aaa12f84f9c/68747470733a2f2f706f7365722e707567782e6f72672f6c6578696b2f6d6f6e6f6c6f672d62726f777365722d62756e646c652f762f737461626c65)](https://packagist.org/packages/lexik/monolog-browser-bundle)[![SensioLabsInsight](https://camo.githubusercontent.com/2af5d5091fcabb7bd1a7e516c4ebdcfdfe390ffa9474b72dc5934605d60c8e6c/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64373362616465312d343135382d343038352d616162382d3130343264333730346137332f6d696e692e706e67)](https://insight.sensiolabs.com/projects/d73bade1-4158-4085-aab8-1042d3704a73)

This Bundle is deprecated
=========================

[](#this-bundle-is-deprecated)

This Symfony2 bundle provides a [Doctrine DBAL](https://github.com/doctrine/dbal) handler for [Monolog](https://github.com/Seldaek/monolog) and a web UI to display log entries. You can list, filter and paginate logs as you can see on the screenshot bellow:

[![Log entries listing](https://github.com/lexik/LexikMonologBrowserBundle/raw/master/Resources/screen/list.jpg)](https://github.com/lexik/LexikMonologBrowserBundle/raw/master/Resources/screen/list.jpg)[![Log entry show](https://github.com/lexik/LexikMonologBrowserBundle/raw/master/Resources/screen/show.jpg)](https://github.com/lexik/LexikMonologBrowserBundle/raw/master/Resources/screen/show.jpg)

As this bundle query your database on each raised log, it's relevant for small and medium projects, but if you have billion of logs consider using a specific log server like [sentry](http://getsentry.com/), [airbrake](https://airbrake.io/), etc.

Requirements:
-------------

[](#requirements)

- Symfony 2.1+
- KnpLabs/KnpPaginatorBundle

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

[](#installation)

Installation with composer:

```
    ...
    "require": {
        ...
        "lexik/monolog-browser-bundle": "~1.0",
        ...
    },
    ...
```

Next, be sure to enable these bundles in your `app/AppKernel.php` file:

```
public function registerBundles()
{
    return array(
        // ...
        new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
        new Lexik\Bundle\MonologBrowserBundle\LexikMonologBrowserBundle(),
        // ...
    );
}
```

Configuration
-------------

[](#configuration)

First of all, you need to configure the Doctrine DBAL connection to use in the handler. You have 2 ways to do that:

**By using an existing Doctrine connection:**

Note: we set the `logging` and `profiling` option to false to avoid DI circular reference.

```
# app/config/config.yml
doctrine:
    dbal:
        connections:
            default:
                ...
            monolog:
                driver:    pdo_sqlite
                dbname:    monolog
                path:      %kernel.root_dir%/cache/monolog2.db
                charset:   UTF8
                logging:   false
                profiling: false

lexik_monolog_browser:
    doctrine:
        connection_name: monolog
```

**By creating a custom Doctrine connection for the bundle:**

```
# app/config/config.yml
lexik_monolog_browser:
    doctrine:
        connection:
            driver:      pdo_sqlite
            driverClass: ~
            pdo:         ~
            dbname:      monolog
            host:        localhost
            port:        ~
            user:        root
            password:    ~
            charset:     UTF8
            path:        %kernel.root_dir%/db/monolog.db # The filesystem path to the database file for SQLite
            memory:      ~                               # True if the SQLite database should be in-memory (non-persistent)
            unix_socket: ~                               # The unix socket to use for MySQL
```

Please refer to the [Doctrine DBAL connection configuration](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#configuration) for more details.

Optionally you can override the schema table name (`monolog_entries` by default):

```
# app/config/config.yml
lexik_monolog_browser:
    doctrine:
        table_name: monolog_entries
```

Now your database is configured, you can generate the schema for your log entry table by running the following command:

```
./app/console lexik:monolog-browser:schema-create
# you should see as result:
# Created table monolog_entries for Doctrine Monolog connection

```

Then, you can configure Monolog to use the Doctrine DBAL handler:

```
# app/config/config_prod.yml # or any env
monolog:
    handlers:
        main:
            type:         fingers_crossed # or buffer
            level:        error
            handler:      lexik_monolog_browser
        app:
            type:         buffer
            action_level: info
            channels:     app
            handler:      lexik_monolog_browser
        deprecation:
            type:         buffer
            action_level: warning
            channels:     deprecation
            handler:      lexik_monolog_browser
        lexik_monolog_browser:
            type:         service
            id:           lexik_monolog_browser.handler.doctrine_dbal
```

Now you have enabled and configured the handler, you migth want to display log entries, just import the routing file:

```
# app/config/routing.yml
lexik_monolog_browser:
    resource: "@LexikMonologBrowserBundle/Resources/config/routing.xml"
    prefix:   /admin/monolog
```

Translations
------------

[](#translations)

If you wish to use default translations provided in this bundle, make sure you have enabled the translator in your config:

```
# app/config/config.yml
framework:
    translator: ~
```

Overriding default layout
-------------------------

[](#overriding-default-layout)

You can override the default layout of the bundle by using the `base_layout` option:

```
# app/config/config.yml
lexik_monolog_browser:
    base_layout: "LexikMonologBrowserBundle::layout.html.twig"
```

or quite simply with the Symfony way by create a template on `app/Resources/LexikMonologBrowserBundle/views/layout.html.twig`.

Updating the bundle
-------------------

[](#updating-the-bundle)

At each bundle updates, be careful to potential schema updates and because Monolog entries table is disconnected from the rest of your Doctrine entities or models, you have to manualy update the schema.

The bundle comes with a `schema-update` command but in some cases, like on renaming columns, the default behavior is not perfect and you may have a look to Doctrine Migrations (you can read an example on PR #2).

You can execute the command below to visualize SQL diff and execute schema updates:

```
./app/console lexik:monolog-browser:schema-update

```

ToDo
----

[](#todo)

- configure Processors to push into the Handler
- abstract handler and connector for Doctrine and browse another like Elasticsearh
- write Tests

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 85.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 ~407 days

Total

4

Last Release

3521d ago

Major Versions

v0.1.0 → v1.0.02015-05-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/9afe5fb1ecbb4f6432e1ea736f9783b6d138c4484889922acb9b3354188e60a0?d=identicon)[jeremyb](/maintainers/jeremyb)

---

Top Contributors

[![jeremyb](https://avatars.githubusercontent.com/u/134588?v=4)](https://github.com/jeremyb "jeremyb (40 commits)")[![antspk](https://avatars.githubusercontent.com/u/78955792?v=4)](https://github.com/antspk "antspk (2 commits)")[![florianlenz](https://avatars.githubusercontent.com/u/16626192?v=4)](https://github.com/florianlenz "florianlenz (1 commits)")[![samuelems](https://avatars.githubusercontent.com/u/26881719?v=4)](https://github.com/samuelems "samuelems (1 commits)")[![sdieunidou](https://avatars.githubusercontent.com/u/570763?v=4)](https://github.com/sdieunidou "sdieunidou (1 commits)")[![gilles-g](https://avatars.githubusercontent.com/u/377875?v=4)](https://github.com/gilles-g "gilles-g (1 commits)")[![BlueTM](https://avatars.githubusercontent.com/u/662454?v=4)](https://github.com/BlueTM "BlueTM (1 commits)")

---

Tags

bundledoctrineSymfony2loggermonolog

### Embed Badge

![Health badge](/badges/lexik-monolog-browser-bundle/health.svg)

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

###  Alternatives

[data-dog/audit-bundle

Audit bundle for symfony2 and doctrine orm, logs any database change

141901.7k1](/packages/data-dog-audit-bundle)[omines/datatables-bundle

Symfony DataTables Bundle with native Doctrine ORM, Elastica and MongoDB support

2851.4M6](/packages/omines-datatables-bundle)[data-dog/pager-bundle

Paginator bundle for symfony2 and doctrine orm, allows customization with filters and sorters

11103.5k7](/packages/data-dog-pager-bundle)

PHPackages © 2026

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