8000 Fix the link to `Monolog\Processor\ProcessorInterface` in processors.rst by marcinowski · Pull Request #10796 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Fix the link to Monolog\Processor\ProcessorInterface in processors.rst #10796

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Remove the ProcessorInterface autoconfigure tip
The `ProcessorInterface` changes were reverted from `symfony/symfony` (more info in #10483), so the tip doesn't seem to be truth, especially since mentioned processors (from https://github.com/symfony/monolog-bridge/blob/master/Processor/) don't even extend the `ProcessorInterface`.
  • Loading branch information
marcinowski authored Dec 20, 2018
commit 7119704c6f649d6f412b073cf0e1346b1c9e07b0
52 changes: 0 additions & 52 deletions logging/processors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,58 +159,6 @@ If you use several handlers, you can also register a processor at the
handler level or at the channel level instead of registering it globally
(see the following sections).

.. tip::

.. versionadded:: 2.4
The autoconfiguration of Monolog processors was introduced in Monolog bundle 2.4.

If you're using the :ref:`default services.yaml configuration <service-container-services-load-example>`,
processors implementing ProcessorInterface_
are automatically registered as services and tagged with ``monolog.processor``,
so you can use them without adding any configuration. The same applies to the
built-in :class:`Symfony\\Bridge\\Monolog\\Processor\\TokenProcessor` and
:class:`Symfony\\Bridge\\Monolog\\Processor\\WebProcessor` processors, which
can be enabled as follows:

.. configuration-block::

.. code-block:: yaml

# config/services.yaml
services:
# Adds the current security token to log entries
Symfony\Bridge\Monolog\Processor\TokenProcessor: ~
# Adds the real client IP to log entries
Symfony\Bridge\Monolog\Processor\WebProcessor: ~

.. code-block:: xml

<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<!-- Adds the current security token to log entries -->
<service id="Symfony\Bridge\Monolog\Processor\TokenProcessor" />
<!-- Adds the real client IP to log entries -->
<service id="Symfony\Bridge\Monolog\Processor\WebProcessor" />
</services>
</container>

.. code-block:: php

// config/services.php
use Symfony\Bridge\Monolog\Processor\TokenProcessor;
use Symfony\Bridge\Monolog\Processor\WebProcessor;

// Adds the current security token to log entries
$container->register(TokenProcessor::class);
// Adds the real client IP to log entries
$container->register(WebProcessor::class);

Registering Processors per Handler
----------------------------------

Expand Down
0