8000 [MonologBridge] access processors only when they exist by xabbuh · Pull Request #34521 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[MonologBridge] access processors only when they exist #34521

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 1 commit into from

Conversation

xabbuh
Copy link
Member
@xabbuh xabbuh commented Nov 22, 2019
Q A
Branch? 5.0
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #34520
License MIT
Doc PR

@jderusse
Copy link
Member

Shouldn't we use the ProcessableHandlerTrait (Seldaek/monolog@902c0c8#diff-d1d031ebe96084844fb53eb650bc404eR24) or extends the AbstractProcessingHandler instead?

@xabbuh
Copy link
Member Author
xabbuh commented Nov 22, 2019

That's not available in Monolog 1, is it?

@jderusse
Copy link
Member

AbstractProcessingHandler does.

Or we can add a compatibility layer (like we usually do)

if (trait_exists(ProcessableHandlerTrait::class)) {
  class ServerLogHandler {
    use AbstractProcessingHandler;
    use ServerLogHandlerTrait;
  }
} else {
  class ServerLogHandler {
    use ServerLogHandlerTrait;
  }
}
trait ServerLogHandlerTrait {
}

@xabbuh
Copy link
Member Author
xabbuh commented Nov 29, 2019

closing in favour of #34697

@xabbuh xabbuh closed this Nov 29, 2019
@xabbuh xabbuh deleted the issue-34520 branch November 29, 2019 16:33
nicolas-grekas added a commit that referenced this pull request Nov 29, 2019
… Monolog 2 (jderusse)

This PR was merged into the 5.0 branch.

Discussion
----------

[MonologBridge] Fix compatibility of ServerLogHandler with Monolog 2

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #34520
| License       | MIT
| Doc PR        | NA

This is an alternative to #34521 that keep compatibility with "processors" and "formaters".

Commits
-------

bdb10f7 Fix compatibility with Monolog 2
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.

3 participants
0