Join GitHub today
[HttpKernel][FrameworkBundle] Add a minimalist default PSR-3 logger #24300
This PR provides a minimalist PSR-3 logger that is always available when FrameworkBundle is installed.
This approach has several benefits:
So, this PR aims to provide a sensible default logger, when not using MonologBundle, for instance when starting a simple project with flex.
I like it :)
I wonder: would it be interesting to allow not interpolating messages, but inline context at the end (see Monolog's LineFormatter)? It'll allow better aggregation, but I don't know if the logging systems you mentioned could leverage it easily.
I've changed the way levels are handled:
I've also fixed most comments, thanks everybody for the review.
the logger should have a "reset" method, and be tagged "kernel.reset".
AFAIK, most platforms doesn't support that unless you use their proprietary API (ex for Stackdriver: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry).
IMO we should keep this builtin logger as small and standard as possible and recommend to use other libraries such as Monolog for more advanced uses like this one... until a standard appears.