-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
LoggerInterface and Monolog #5968
Comments
Also, I forgot to mention that a Logger must always be an optional dependency. |
Which brings us to 2) and 3)
and
TLDR 👍 for 3 |
I am just having this problem with the Security component standalone (wanting to pass my Monolog instance to constructors which want an instance of Symfony LoggerInterface). +1 for option three. |
+1 for option three |
+1 for option three The "Symfony Logger component" is a good idea but I don't see a need for it right now. |
Just FYI since not everyone here is following the PHP-FIG mailing list I guess, I started a proposal for a PSR LoggerInterface - if we get that then it'll be possible to rely on that instead of relying on monolog. It's a slightly more neutral approach. I'll do my best to push this forward before end of the year. |
The PSR LoggerInterface sounds good. I still think that the quickest and better solution (for this issue) is Monolog. |
@p16 but I don't think refactoring all component to depend on Monolog itself just in the meantime is worth it (they will still need to be refactored all to depend on the PSR interface). So if we wait for the PSR interface, I suggest keeping the existing interface in the meantime. @Seldaek could you link to the discussion ? |
@stof I agree with you, my only concern is how long it's going to take to have a PSR LoggerInterface. |
The deadline to implement our choice for 2.2 is the end of december. |
it seems that people would either wait for FIG to figure out what they want or for a Monolog standardization. As far as I can see, FIG is pretty dormant, in the sense that they don't actively maintain the open issues on GH nor anything else bigger is being talked about in the past 6 months or so ... Imho, having end of the year as a dead-line is also a bit close as most of the people would get away with family / friends and so on. So the only thing that comes natural is using Monolog and provide some sort of bridge when FIG will decide something about this. |
It seems that people prefer to talk than help get shit done. PR is at php-fig/fig-standards#60 - you can find the previous discussion at https://groups.google.com/forum/?fromgroups=#!topic/php-fig/yL_wDyiT6GY%5B1-25%5D - if no big opposition suddenly appears I will move it to vote soon, and hopefully we have something standardized by the end of the year. As soon as things seem to go in the right direction we can begin implementing the changes in symfony to make sure stuff is ready on time. |
I would also favor option 1. This is exactly the problem space that FIG proposal is intended to solve, and it is the most promising discussion the FIG group has had to date. :-) |
One alternative to option 2 is to implement #6129 and move the |
@dlsniper there is already a branch in Monolog making it compatible. Note that it is incompatible with the current MonologBridge as some method names are the same in the PSR interface and the HttpKernel one. |
FYI, the branch has been merged into Monolog master today |
About #6560, due to yesterday Monolog merge : |
The first option was chosen as PSR-3 is now out. See #6628 for the PR that will this gappen. |
@frosas it wasn't merged yet, so no. And it's nothing to do with twig really, so I doubt it. Maybe the latest twig release broke something though. Anyway I would open a new issue somewhere else :) |
@Seldaek sorry, the comment was for another issue. |
As of today, we have a
LoggerInterface
declared in the HttpKernel component. This can be problematic for components that need a logger but do not depend on HttpKernel.There are several options here to fix this "issue":
1/ Let the FIG group decide on an interface and rely on the FIG package that would declare this interface (keep in mind that we need to have something stable by the end of December for Symfony 2.2);
2/ Create a new Symfony component with just the
LoggerInterface
file;3/ Remove the interface altogether and rely on Monolog instead;
4/ Create a Symfony Logger component that support both Monolog and the Zend Logger;
5/ Do nothing.
see #5911 for the start of the discussion.
I tend to prefer option 3 for the many reasons:
The text was updated successfully, but these errors were encountered: