Skip to content

Commit

Permalink
Merge branch '7.2' into 7.3
Browse files Browse the repository at this point in the history
* 7.2:
  Minor tweaks
  [Logging] Add references to the `ConsoleLogger`
  • Loading branch information
javiereguiluz committed Jan 22, 2025
2 parents 8278355 + dc81cd0 commit f9340ba
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions logging.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Logging
=======

Symfony comes with a minimalist `PSR-3`_ logger: :class:`Symfony\\Component\\HttpKernel\\Log\\Logger`.
In conformance with `the twelve-factor app methodology`_, it sends messages starting from the
``WARNING`` level to `stderr`_.
Symfony comes with two minimalist `PSR-3`_ loggers: :class:`Symfony\\Component\\HttpKernel\\Log\\Logger`
for the HTTP context and :class:`Symfony\\Component\\Console\\Logger\\ConsoleLogger` for the
CLI context. In conformance with `the twelve-factor app methodology`_, they send messages
starting from the ``WARNING`` level to `stderr`_.

The minimal log level can be changed by setting the ``SHELL_VERBOSITY`` environment variable:

Expand All @@ -17,8 +18,13 @@ The minimal log level can be changed by setting the ``SHELL_VERBOSITY`` environm
========================= =================

The minimum log level, the default output and the log format can also be changed by
passing the appropriate arguments to the constructor of :class:`Symfony\\Component\\HttpKernel\\Log\\Logger`.
To do so, :ref:`override the "logger" service definition <service-psr4-loader>`.
passing the appropriate arguments to the constructor of :class:`Symfony\\Component\\HttpKernel\\Log\\Logger`
and :class:`Symfony\\Component\\Console\\Logger\\ConsoleLogger`.

The :class:`Symfony\\Component\\HttpKernel\\Log\\Logger` class is available through the ``logger`` service.
To pass your configuration, you can :ref:`override the "logger" service definition <service-psr4-loader>`.

For more information about ``ConsoleLogger``, see :doc:`/components/console/logger`.

Logging a Message
-----------------
Expand Down

0 comments on commit f9340ba

Please sign in to comment.