-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] Extract the built-in Logger to a separate component #59527
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
Comments
But this logger is not a component. It's based on PSR and is just for the HttpKernel component, as its code is hardly bound to that component. There is almost nothing that could be useful about having this logger as a component. PSR abstract implementation or Monolog are perfect components that are already re-usable. |
And this DebugLoggerInterface is related to the profiler to collect logs (and the profiler is part of the HttpKernel component) |
Sure. I think both assertions are great describing the current implementation. |
For CLI applications, you can use the Console Logger. |
@phansys if we extract this logger without the parts coupled to HttpKernel, the class would be a very basic PSR-3 implementation writing to STDERR. This does not warrant a dedicated component IMO. And we don't want to create a logger component supporting more advanced cases either (that's already handled properly by Monolog). This component would also not be defining a logger contract as we rely on the PSR-3 LoggerInterface for that. |
Good point, I didn't remember this. Could we then add a note in the Logging docs about the intended usage for each one of these loggers? If you agree, I can create a PR. Thank you! |
Yes mentioning the Console Logger on this page would be a good idea. |
Closing as it seems we agree that this won't happen. |
This PR was submitted for the 7.1 branch but it was merged into the 6.4 branch instead. Discussion ---------- [Logging] Add references to the `ConsoleLogger` See symfony/symfony#59527. Commits ------- b9c7139 [Logging] Add references to the `ConsoleLogger`
Description
This RFC proposes to move the built-in PSR-3
Logger
to its own component.The reasoning behind this proposal is maybe wider
Given these assertions, the provided logger may be used even in pure CLI applications, where the HTTP context does not even exist. That's why I found weird that the logger is provided by a component that uses the HTTP term in its name.
Example
The text was updated successfully, but these errors were encountered: