Download the PHP package lexik/monolog-browser-bundle without Composer
On this page you can find all versions of the php package lexik/monolog-browser-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package monolog-browser-bundle
LexikMonologBrowserBundle
This Bundle is deprecated
This Symfony2 bundle provides a Doctrine DBAL handler for Monolog and a web UI to display log entries. You can list, filter and paginate logs as you can see on the screenshot bellow:
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, airbrake, etc.
Requirements:
- Symfony 2.1+
- KnpLabs/KnpPaginatorBundle
Installation
Installation with composer:
Next, be sure to enable these bundles in your app/AppKernel.php
file:
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.
By creating a custom Doctrine connection for the bundle:
Please refer to the Doctrine DBAL connection configuration for more details.
Optionally you can override the schema table name (monolog_entries
by default):
Now your database is configured, you can generate the schema for your log entry table by running the following command:
Then, you can configure Monolog to use the Doctrine DBAL handler:
Now you have enabled and configured the handler, you migth want to display log entries, just import the routing file:
Translations
If you wish to use default translations provided in this bundle, make sure you have enabled the translator in your config:
Overriding default layout
You can override the default layout of the bundle by using the base_layout
option:
or quite simply with the Symfony way by create a template on app/Resources/LexikMonologBrowserBundle/views/layout.html.twig
.
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:
ToDo
- configure Processors to push into the Handler
- abstract handler and connector for Doctrine and browse another like Elasticsearh
- write Tests
All versions of monolog-browser-bundle with dependencies
symfony/framework-bundle Version ~2.1
knplabs/knp-paginator-bundle Version >=2.3