Skip to content

clarify that the ConsoleHandler was added to the MonologBridge and not t... #3403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ You can also set these colors and options inside the tagname::
// bold text on a yellow background
$output->writeln('<bg=yellow;options=bold>foo</bg=yellow;options=bold>');

.. verbosity-levels:
.. _verbosity-levels:

Verbosity Levels
~~~~~~~~~~~~~~~~
Expand Down
21 changes: 11 additions & 10 deletions cookbook/logging/monolog_console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
How to Configure Monolog to Display Console Messages
====================================================

.. versionadded:: 2.3
This feature was introduced to the MonologBundle in version 2.4, which
was first packaged with Symfony at version 2.4 (but compatible with Symfony 2.3).
.. versionadded:: 2.4
This feature was introduced to the MonologBridge in Symfony 2.4.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talking about MonologBundle 2.4 is not wrong. The configuration part is added in MonologBundle 2.4, and most of this article deals with the configuration

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, but MonologBundle 2.4 is already installed if you use the Symfony Standard Edition.

The point is that the ConsoleHandler is part of MonologBridge 2.4. Thus, you can use MonologBundle 2.4 with Symfony 2.3 but can use the handler.


It is possible to use the console to print messages for certain :ref:`verbosity-levels`
using the :class:`Symfony\\Component\\Console\\Output\\OutputInterface`
instance that is passed when a command gets executed.
It is possible to use the console to print messages for certain
:ref:`verbosity levels <verbosity-levels>` using the
:class:`Symfony\\Component\\Console\\Output\\OutputInterface` instance that
is passed when a command gets executed.

When a lot of logging has to happen, it's cumbersome to print information
depending on the verbosity settings (``-v``, ``-vv``, ``-vvv``) because the
Expand All @@ -32,7 +32,7 @@ For example::
}

Instead of using these semantic methods to test for each of the verbosity
levels, `MonologBundle`_ 2.4 provides a `ConsoleHandler`_ that listens to
levels, the `MonologBridge`_ provides a `ConsoleHandler`_ that listens to
console events and writes log messages to the console output depending on the
current log level and the console verbosity.

Expand Down Expand Up @@ -96,8 +96,9 @@ With the ``verbosity_levels`` option you can adapt the mapping between
verbosity and log level. In the given example it will also show notices in
normal verbosity mode (instead of warnings only). Additionally, it will only
use messages logged with the custom ``my_channel`` channel and it changes the
display style via a custom formatter. See also the :doc:`reference/configuration/monolog`
for more information:
display style via a custom formatter (see the
:doc:`MonologBundle reference </reference/configuration/monolog>` for more
information):

.. configuration-block::

Expand Down Expand Up @@ -180,4 +181,4 @@ for more information:
;

.. _ConsoleHandler: https://github.com/symfony/MonologBridge/blob/master/Handler/ConsoleHandler.php
.. _MonologBundle: https://github.com/symfony/MonologBundle
.. _MonologBridge: https://github.com/symfony/MonologBridge