We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50c8385 commit c8992e6Copy full SHA for c8992e6
logging.rst
@@ -308,6 +308,15 @@ option of your handler to ``rotating_file``:
308
),
309
));
310
311
+Injecting a Logger into a Service
312
+----------------------------------
313
+
314
+To use a logger in your own service, inject it using Dependency Injection
315
+with ``@logger``. If you want to use a pre-configured logger which uses a
316
+specific channel (``app`` by default), use the ``monolog.logger`` tag with the
317
+``channel`` property. Look at the :ref:`Dependency Injection reference
318
+<dic_tags-monolog>` for more information and an example.
319
320
Adding extra Data to each Log (e.g. a unique request token)
321
-----------------------------------------------------------
322
0 commit comments