Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors #27801

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

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jul 2, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR symfony/symfony-docs#9996

Using this, enabling e.g. TokenProcessor or WebProcessor just needs one line in services.yaml:

services:
    Symfony\Bridge\Monolog\Processor\TokenProcessor: ~
    Symfony\Bridge\Monolog\Processor\WebProcessor: ~

Copy link
Member

@lyrixx lyrixx left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

In think it deserves a linked PR for the docs.

4.2.0
-----

* added `ProcessorInterface`: an optional interface to allow autoconfiguration of monolog processors
Copy link
Member

Choose a reason for hiding this comment

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

Monolog

namespace Symfony\Bridge\Monolog\Processor;

/**
* An optional interface to allow autoconfiguration of monolog processors.
Copy link
Member

Choose a reason for hiding this comment

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

Monolog

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@nicolas-grekas
Copy link
Member Author

doc PR added

@fabpot
Copy link
Member

fabpot commented Jul 3, 2018

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 28a4912 into symfony:master Jul 3, 2018
fabpot added a commit that referenced this pull request Jul 3, 2018
…onfiguration of monolog processors (nicolas-grekas)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#9996

Using this, enabling e.g. TokenProcessor or WebProcessor just needs one line in `services.yaml`:
```yaml
services:
    Symfony\Bridge\Monolog\Processor\TokenProcessor: ~
    Symfony\Bridge\Monolog\Processor\WebProcessor: ~
```

Commits
-------

28a4912 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors
@nicolas-grekas nicolas-grekas deleted the log-proc branch July 4, 2018 13:28
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jul 6, 2018
…las-grekas, javiereguiluz)

This PR was merged into the master branch.

Discussion
----------

Tell about ProcessorInterface in logging/processors

Doc for symfony/symfony#27801

Commits
-------

ad2bad9 Minor reword
0c9c90f Tell about ProcessorInterface in logging/processors
nicolas-grekas added a commit that referenced this pull request Aug 8, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI] Allow autoconfiguring bindings

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I've come up with a case where we will need to inject a different service based on which interfaces a consumer service implements: injecting a different token storage for monolog processor than for everything else. Required in #27801.

Commits
-------

7c29977 [DI] Allow autoconfiguring bindings
nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull request Oct 12, 2018
… enabling autoconfiguration of monolog processors (nicolas-grekas)"

This reverts commit f27c3a8, reversing
changes made to 9da0454.
fabpot added a commit that referenced this pull request Oct 13, 2018
…rface, enabling autoconfiguration of monolog processors" (nicolas-grekas)

This PR was merged into the 4.2-dev branch.

Discussion
----------

Revert "feature #27801 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors"

This reverts commit f27c3a8, reversing
changes made to 9da0454.

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

A bridge shouldn't provide interfaces to me so I submitted Seldaek/monolog#1204 instead.

This PR reverts the possibility to autoconfigure processors for now, so that it could be moved to the MonologBundle instead.

To have TokenProcessor and WebProcessor classes implement the new ProcessorInterface, we could bump the minimum version of monolog. This cannot be done until a new version of it is tagged, so we need to resolve this before tagging 4.2 ourselves.

Commits
-------

cfc3f25 Revert "feature #27801 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors (nicolas-grekas)"
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Nov 9, 2018
This PR was merged into the master branch.

Discussion
----------

[Monolog] Move ProcessorInterface to Monolog

Since symfony/symfony#27801 was reverted in symfony/symfony#28845 and the new plan being to make this interface part of Monolog.

Commits
-------

663f2ea [Monolog] Move ProcessorInterface to Monolog
*
* @author Nicolas Grekas <[email protected]>
*/
interface ProcessorInterface
Copy link
Member

Choose a reason for hiding this comment

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

Funny, for twig you forced me to add this interface in twig itself.
Why didn't you do the same thing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did, see #28845
This has been reverted and added to Monolog meanwhile :)

Copy link
Member

Choose a reason for hiding this comment

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

Ahah. Thanks

@lyrixx
Copy link
Member

lyrixx commented Dec 21, 2018

Hello,

I'm a bit lost. This PR have been reverted, and some code has been move to monolog.
But it seems the auto-configuration part has been lost.

More over the docs has not been reverted symfony/symfony-docs#9996

on https://symfony.com/doc/current/logging/processors.html
we say:

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

But this version does not exist.

Finally, This feature does not work. I don't know what is intended here.

@nicolas-grekas
Copy link
Member Author

See symfony/monolog-bundle#285 which isn't merged yet but should.
Looks like I made a mistake about the version number, should be 3.4.
Fix welcome + help to lobby the PR to have it merged ;)

@xabbuh
Copy link
Member

xabbuh commented Dec 22, 2018

@lyrixx see symfony/symfony-docs#10796 for the documentation update

lyrixx added a commit to symfony/monolog-bundle that referenced this pull request May 16, 2019
This PR was merged into the 3.x-dev branch.

Discussion
----------

Register processors for autoconfiguration

Replaces symfony/symfony#27801 (which has been reverted meanwhile)
Leverages Seldaek/monolog#1204
Already documented in symfony/symfony-docs#9996 (but doc needs update)

Commits
-------

7fdda67 Register processors for autoconfiguration
dani-danigm pushed a commit to dani-danigm/monolog-bundle that referenced this pull request Jun 15, 2022
This PR was merged into the 3.x-dev branch.

Discussion
----------

Register processors for autoconfiguration

Replaces symfony/symfony#27801 (which has been reverted meanwhile)
Leverages Seldaek/monolog#1204
Already documented in symfony/symfony-docs#9996 (but doc needs update)

Commits
-------

84c0564 Register processors for autoconfiguration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants