File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,16 @@ option of your handler to ``rotating_file``:
338
338
Using a Logger inside a Service
339
339
-------------------------------
340
340
341
+ If your application uses :ref: `service autoconfiguration <services-autoconfigure >`,
342
+ any service whose class implements ``Psr\Log\LoggerAwareInterface `` will
343
+ receive a call to its method ``setLogger() `` with the default logger service
344
+ passed as a service.
345
+
346
+ .. versionadded :: 4.2
347
+
348
+ The automatic call to ``setLogger() `` when implementing ``LoggerAwareInterface ``
349
+ was introduced in Symfony 4.2.
350
+
341
351
If you want to use in your own services a pre-configured logger which uses a
342
352
specific channel (``app `` by default), use the ``monolog.logger `` tag with the
343
353
``channel `` property as explained in the
You can’t perform that action at this time.
0 commit comments