[GH-ISSUE #183] Terminal / Echo Handler #60

Closed
opened 2026-03-04 02:11:46 +03:00 by kerem · 1 comment
Owner

Originally created by @SteveEdson on GitHub (Apr 22, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/183

I have some scripts that are sometimes executed manually, where the output is monitored in the terminal, and other times they run in the background as a scheduled task, where the output should be appended to a text file.

Are there any handlers that can be used to output to the browser / terminal? Ideally it could detect which one, and use <br /> or \n for new lines, accordingly.

Originally created by @SteveEdson on GitHub (Apr 22, 2013). Original GitHub issue: https://github.com/Seldaek/monolog/issues/183 I have some scripts that are sometimes executed manually, where the output is monitored in the terminal, and other times they run in the background as a scheduled task, where the output should be appended to a text file. Are there any handlers that can be used to output to the browser / terminal? Ideally it could detect which one, and use `<br />` or `\n` for new lines, accordingly.
kerem closed this issue 2026-03-04 02:11:46 +03:00
Author
Owner

@Seldaek commented on GitHub (Apr 22, 2013):

For terminal you can pass "php://output" into a StreamHandler. It should work too in a browser if you echo a <pre> before, otherwise you could configure the handler to use another LineFormatter that outputs <br> at the end of the line.

<!-- gh-comment-id:16776978 --> @Seldaek commented on GitHub (Apr 22, 2013): For terminal you can pass `"php://output"` into a StreamHandler. It should work too in a browser if you echo a `<pre>` before, otherwise you could configure the handler to use another LineFormatter that outputs `<br>` at the end of the line.
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#60
No description provided.