[GH-ISSUE #1728] Why does BrowserConsoleHandler always use console.log? #724

Closed
opened 2026-03-04 02:17:25 +03:00 by kerem · 2 comments
Owner

Originally created by @pafernandez-oesia on GitHub (Jul 8, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1728

Hi!

I was just wondering if there is any reason to use console.log method for all log levels, instead of also using debug, info, warn and error methods depending on the log level. This makes filtering output easier in the browser console and clearly highlights error level messages.

The following image shows an example output from Laravel using Monolog and a custom implementation of BrowserConsoleHandler:

image

I can make a PR if you find it useful.

Kind regards,

Originally created by @pafernandez-oesia on GitHub (Jul 8, 2022). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1728 Hi! I was just wondering if there is any reason to use `console.log` method for all log levels, instead of also using `debug`, `info`, `warn` and `error` methods depending on the log level. This makes filtering output easier in the browser console and clearly highlights error level messages. The following image shows an example output from Laravel using Monolog and a custom implementation of `BrowserConsoleHandler`: ![image](https://user-images.githubusercontent.com/96843912/177963365-5fa14776-1666-40c4-9a6c-909d36b0e68d.png) I can make a PR if you find it useful. Kind regards,
kerem 2026-03-04 02:17:25 +03:00
  • closed this issue
  • added the
    Feature
    label
Author
Owner

@Seldaek commented on GitHub (Jul 22, 2022):

Yeah that sounds good, I think it's mostly because this was done when browser consoles were still pretty basic :)

<!-- gh-comment-id:1192508957 --> @Seldaek commented on GitHub (Jul 22, 2022): Yeah that sounds good, I think it's mostly because this was done when browser consoles were still pretty basic :)
Author
Owner

@Seldaek commented on GitHub (Aug 2, 2022):

Fixed by https://github.com/Seldaek/monolog/pull/1739

<!-- gh-comment-id:1202401874 --> @Seldaek commented on GitHub (Aug 2, 2022): Fixed by https://github.com/Seldaek/monolog/pull/1739
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#724
No description provided.