Commit 340b6ce2 authored by Igor Wiedler's avatar Igor Wiedler

[docs] add usage section for MonologExtension

parent fb31ac4d
...@@ -52,3 +52,30 @@ directory. ...@@ -52,3 +52,30 @@ directory.
'monolog.logfile' => __DIR__.'/development.log', 'monolog.logfile' => __DIR__.'/development.log',
'monolog.class_path' => __DIR__.'/vendor/monolog/src', 'monolog.class_path' => __DIR__.'/vendor/monolog/src',
)); ));
.. note::
Monolog is not compiled into the ``silex.phar`` file. You have to
add your own copy of Monolog to your application.
Usage
-----
The MonologExtension provides a ``monolog`` service. You can use
it to add log entries for any logging level through ``addDebug()``,
``addInfo()``, ``addWarning()`` and ``addError()``.
::
use Symfony\Component\HttpFoundation\Response;
$app->post('/user', function () use ($app) {
// ...
$app['monolog']->addInfo(sprintf("User '%s' registered.", $username));
return new Response('', 201);
});
For more information, check out the `Monolog documentation
<https://github.com/Seldaek/monolog>`_.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment