11Logging
22=======
33
4- Symfony comes with a minimalist `PSR-3 `_ logger::class: `Symfony\\ Component\\ HttpKernel\\ Log\\ Logger `.
5- In conformance with `the twelve-factor app methodology `_, it sends messages starting from the
4+ Symfony comes with two minimalist `PSR-3 `_ loggers::class: `Symfony\\ Component\\ HttpKernel\\ Log\\ Logger `
5+ for the HTTP context and:class: `Symfony\\ Component\\ Console\\ Logger\\ ConsoleLogger ` for the
6+ CLI context.
7+ In conformance with `the twelve-factor app methodology `_, they send messages starting from the
68``WARNING `` level to `stderr `_.
79
810The minimal log level can be changed by setting the ``SHELL_VERBOSITY `` environment variable:
@@ -17,13 +19,18 @@ The minimal log level can be changed by setting the ``SHELL_VERBOSITY`` environm
1719========================= =================
1820
1921The minimum log level, the default output and the log format can also be changed by
20- passing the appropriate arguments to the constructor of:class: `Symfony\\ Component\\ HttpKernel\\ Log\\ Logger `.
21- To do so,:ref: `override the "logger" service definition <service-psr4-loader >`.
22+ passing the appropriate arguments to the constructor of:class: `Symfony\\ Component\\ HttpKernel\\ Log\\ Logger `
23+ and:class: `Symfony\\ Component\\ Console\\ Logger\\ ConsoleLogger `.
24+
25+ The:class: `Symfony\\ Component\\ HttpKernel\\ Log\\ Logger ` class is available through the ``logger `` service.
26+ To pass your configuration, you can:ref: `override the "logger" service definition <service-psr4-loader >`.
27+
28+ For more information about ``ConsoleLogger ``, see:doc: `/components/console/logger `.
2229
2330Logging a Message
2431-----------------
2532
26- To log a message, inject the default logger in your controller or service::
33+ To log a message using the `` logger `` service , inject the default logger in your controller or service::
2734
2835 use Psr\Log\LoggerInterface;
2936 // ...
@@ -55,7 +62,7 @@ Adding placeholders to log messages is recommended because:
5562* It's better for security, because escaping can then be done by the
5663 implementation in a context-aware fashion.
5764
58- The`` logger `` service has different methods for different logging levels/priorities.
65+ The logger implementations has different methods for different logging levels/priorities.
5966See `LoggerInterface `_ for a list of all of the methods on the logger.
6067
6168Monolog