recipes icon indicating copy to clipboard operation
recipes copied to clipboard

Switch default Monolog formatter to new Syslog formatter when@dev

Open dkarlovi opened this issue 2 years ago • 3 comments

After https://github.com/symfony/monolog-bundle/issues/441 is implemented, we can switch the dev.log to it.

Why

Currently the log file in dev is just a bunch of text, it's almost unreadable because of how busy it is. With tool like https://lnav.org/, this changes because you can get features like syntax highlight, advanced filtering, display customizations etc without any configuration (Syslog is recognized by default), improving the current situation where you can do similar thing with Idealog, but with custom config, etc.

See a quick example how it could look like: https://github.com/Seldaek/monolog/pull/1689#issuecomment-1158141244

Note: colors in the video are configurable, I know @javiereguiluz had issues with them in Slack. :)

dkarlovi avatar Jul 22 '22 14:07 dkarlovi

I like this idea 👍

I don't know if this change could "break" logs for some folks, but it'd be great to make this change (if possible) because having Symfony logs formatted by default in PhpStorm without installing or configuring anything would be amazing. Thanks!

javiereguiluz avatar Jul 22 '22 14:07 javiereguiluz

I think it should be part of the recipe but I'd maybe leave it commented out as a hint, and default to text, because while it is a bit of a mess, it is the only true cross platform solution.

Seldaek avatar Jul 22 '22 14:07 Seldaek

@Seldaek I'm :+1: with having a commented out formatter, easy enough to switch on and the feature is visible enough for those who want it, it might not be for everyone indeed.

dkarlovi avatar Jul 22 '22 14:07 dkarlovi