[PR #33] [MERGED] Rich logging #891

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

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/33
Author: @stof
Created: 5/31/2011
Status: Merged
Merged: 6/17/2011
Merged by: @Seldaek

Base: masterHead: rich_logging


📝 Commits (4)

  • a8d4fc4 Tweaked the formatting of complex data in the LineFormatter
  • c1675c5 Added the support of a logging context
  • e9f3e0c Moved the channel as label on the FirePHP message for a better formatting
  • 0d728fe Fixed forwarding of the context in logging calls

📊 Changes

14 files changed (+115 additions, -88 deletions)

View changed files

📝 src/Monolog/Formatter/FormatterInterface.php (+3 -3)
📝 src/Monolog/Formatter/LineFormatter.php (+30 -16)
📝 src/Monolog/Formatter/WildfireFormatter.php (+2 -1)
📝 src/Monolog/Handler/AbstractProcessingHandler.php (+1 -1)
📝 src/Monolog/Handler/FirePHPHandler.php (+1 -1)
📝 src/Monolog/Handler/MailHandler.php (+2 -4)
📝 src/Monolog/Handler/StreamHandler.php (+1 -1)
📝 src/Monolog/Handler/SyslogHandler.php (+1 -1)
📝 src/Monolog/Logger.php (+46 -30)
📝 tests/Monolog/Formatter/JsonFormatterTest.php (+1 -0)
📝 tests/Monolog/Formatter/LineFormatterTest.php (+13 -7)
📝 tests/Monolog/Formatter/WildfireFormatterTest.php (+7 -17)
📝 tests/Monolog/Handler/FirePHPHandlerTest.php (+6 -6)
📝 tests/Monolog/TestCase.php (+1 -0)

📄 Description

This adds the support of a logging context in Monolog. Currently, our handlers are mostly poor handler so they format it using LineFormatter as they can (the formatting has been improved to make arrays readable).

The feature will be used in the InsightHandler (see #30) with a new PR coming based on it.
The implementation of #18 would also be possible now IMO (but I will not do it for now. I don't use GELF so it is not my priority).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/33 **Author:** [@stof](https://github.com/stof) **Created:** 5/31/2011 **Status:** ✅ Merged **Merged:** 6/17/2011 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `rich_logging` --- ### 📝 Commits (4) - [`a8d4fc4`](https://github.com/Seldaek/monolog/commit/a8d4fc4a34c6abc9928735d56aa5653b5d0834d7) Tweaked the formatting of complex data in the LineFormatter - [`c1675c5`](https://github.com/Seldaek/monolog/commit/c1675c59d8dbf50e16fa776917030eb03efa6206) Added the support of a logging context - [`e9f3e0c`](https://github.com/Seldaek/monolog/commit/e9f3e0c2d70ea39a2883599561f4c9160690f78f) Moved the channel as label on the FirePHP message for a better formatting - [`0d728fe`](https://github.com/Seldaek/monolog/commit/0d728feb7c53eb4151c8c2228e81fe59cd859d6c) Fixed forwarding of the context in logging calls ### 📊 Changes **14 files changed** (+115 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `src/Monolog/Formatter/FormatterInterface.php` (+3 -3) 📝 `src/Monolog/Formatter/LineFormatter.php` (+30 -16) 📝 `src/Monolog/Formatter/WildfireFormatter.php` (+2 -1) 📝 `src/Monolog/Handler/AbstractProcessingHandler.php` (+1 -1) 📝 `src/Monolog/Handler/FirePHPHandler.php` (+1 -1) 📝 `src/Monolog/Handler/MailHandler.php` (+2 -4) 📝 `src/Monolog/Handler/StreamHandler.php` (+1 -1) 📝 `src/Monolog/Handler/SyslogHandler.php` (+1 -1) 📝 `src/Monolog/Logger.php` (+46 -30) 📝 `tests/Monolog/Formatter/JsonFormatterTest.php` (+1 -0) 📝 `tests/Monolog/Formatter/LineFormatterTest.php` (+13 -7) 📝 `tests/Monolog/Formatter/WildfireFormatterTest.php` (+7 -17) 📝 `tests/Monolog/Handler/FirePHPHandlerTest.php` (+6 -6) 📝 `tests/Monolog/TestCase.php` (+1 -0) </details> ### 📄 Description This adds the support of a logging context in Monolog. Currently, our handlers are mostly poor handler so they format it using LineFormatter as they can (the formatting has been improved to make arrays readable). The feature will be used in the InsightHandler (see #30) with a new PR coming based on it. The implementation of #18 would also be possible now IMO (but I will not do it for now. I don't use GELF so it is not my priority). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:02:25 +03:00
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#891
No description provided.