Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix the link toMonolog\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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
marcinowski wants to merge2 commits intosymfony:4.2frommarcinowski:patch-3
Closed
Changes fromall commits
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
54 changes: 2 additions & 52 deletionslogging/processors.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 :class:`Monolog\\Processor\\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 DownExpand Up@@ -298,3 +246,5 @@ the ``monolog.processor`` tag:
$container
->register(SessionRequestProcessor::class)
->addTag('monolog.processor', array('channel' => 'main'));

.. _ProcessorInterface: https://github.com/Seldaek/monolog/blob/master/src/Monolog/Processor/ProcessorInterface.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

can be removed too


[8]ページ先頭

©2009-2025 Movatter.jp