Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
340b6ce2
Commit
340b6ce2
authored
Aug 08, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] add usage section for MonologExtension
parent
fb31ac4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
doc/extensions/monolog.rst
doc/extensions/monolog.rst
+27
-0
No files found.
doc/extensions/monolog.rst
View file @
340b6ce2
...
@@ -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>`_.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment