[PR #793] [MERGED] Datetime changes #1358

Closed
opened 2026-03-04 03:10:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/793
Author: @Seldaek
Created: 5/20/2016
Status: Merged
Merged: 5/26/2016
Merged by: @Seldaek

Base: masterHead: datetime-changes


📝 Commits (2)

  • e27225d Switch to DateTimeImmutable everywhere
  • 912d813 Add our own DateTime implementation to provide nicer JSON output, fixes #736

📊 Changes

24 files changed (+140 additions, -83 deletions)

View changed files

src/Monolog/DateTimeImmutable.php (+48 -0)
📝 src/Monolog/Formatter/LogglyFormatter.php (+1 -1)
📝 src/Monolog/Formatter/NormalizerFormatter.php (+1 -1)
📝 src/Monolog/Formatter/WildfireFormatter.php (+1 -1)
📝 src/Monolog/Handler/ChromePHPHandler.php (+2 -2)
📝 src/Monolog/Handler/RotatingFileHandler.php (+2 -2)
📝 src/Monolog/Logger.php (+14 -6)
📝 src/Monolog/Test/TestCase.php (+2 -1)
📝 tests/Monolog/Formatter/ChromePHPFormatterTest.php (+5 -5)
📝 tests/Monolog/Formatter/ElasticaFormatterTest.php (+1 -1)
📝 tests/Monolog/Formatter/FluentdFormatterTest.php (+2 -2)
📝 tests/Monolog/Formatter/GelfMessageFormatterTest.php (+6 -6)
📝 tests/Monolog/Formatter/JsonFormatterTest.php (+5 -5)
📝 tests/Monolog/Formatter/LineFormatterTest.php (+11 -11)
📝 tests/Monolog/Formatter/LogglyFormatterTest.php (+1 -1)
📝 tests/Monolog/Formatter/LogstashFormatterTest.php (+6 -6)
📝 tests/Monolog/Formatter/MongoDBFormatterTest.php (+7 -7)
📝 tests/Monolog/Formatter/NormalizerFormatterTest.php (+3 -3)
📝 tests/Monolog/Formatter/ScalarFormatterTest.php (+1 -1)
📝 tests/Monolog/Formatter/WildfireFormatterTest.php (+5 -5)

...and 4 more files

📄 Description

Fixes #736

  • Uses DateTimeImmutable for everything
  • Added our own class extending it that means datetimes get serialized in json as "Y-m-d\TH:i:s.uP" or "Y-m-d\TH:i:sP" depending if microsecond precision is enabled.

Feedback welcome :)


🔄 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/793 **Author:** [@Seldaek](https://github.com/Seldaek) **Created:** 5/20/2016 **Status:** ✅ Merged **Merged:** 5/26/2016 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `datetime-changes` --- ### 📝 Commits (2) - [`e27225d`](https://github.com/Seldaek/monolog/commit/e27225dc402bfdcfabc336832110256f9b6de5ab) Switch to DateTimeImmutable everywhere - [`912d813`](https://github.com/Seldaek/monolog/commit/912d813c7345ffe97ddcf1469bd3223fdf27d538) Add our own DateTime implementation to provide nicer JSON output, fixes #736 ### 📊 Changes **24 files changed** (+140 additions, -83 deletions) <details> <summary>View changed files</summary> ➕ `src/Monolog/DateTimeImmutable.php` (+48 -0) 📝 `src/Monolog/Formatter/LogglyFormatter.php` (+1 -1) 📝 `src/Monolog/Formatter/NormalizerFormatter.php` (+1 -1) 📝 `src/Monolog/Formatter/WildfireFormatter.php` (+1 -1) 📝 `src/Monolog/Handler/ChromePHPHandler.php` (+2 -2) 📝 `src/Monolog/Handler/RotatingFileHandler.php` (+2 -2) 📝 `src/Monolog/Logger.php` (+14 -6) 📝 `src/Monolog/Test/TestCase.php` (+2 -1) 📝 `tests/Monolog/Formatter/ChromePHPFormatterTest.php` (+5 -5) 📝 `tests/Monolog/Formatter/ElasticaFormatterTest.php` (+1 -1) 📝 `tests/Monolog/Formatter/FluentdFormatterTest.php` (+2 -2) 📝 `tests/Monolog/Formatter/GelfMessageFormatterTest.php` (+6 -6) 📝 `tests/Monolog/Formatter/JsonFormatterTest.php` (+5 -5) 📝 `tests/Monolog/Formatter/LineFormatterTest.php` (+11 -11) 📝 `tests/Monolog/Formatter/LogglyFormatterTest.php` (+1 -1) 📝 `tests/Monolog/Formatter/LogstashFormatterTest.php` (+6 -6) 📝 `tests/Monolog/Formatter/MongoDBFormatterTest.php` (+7 -7) 📝 `tests/Monolog/Formatter/NormalizerFormatterTest.php` (+3 -3) 📝 `tests/Monolog/Formatter/ScalarFormatterTest.php` (+1 -1) 📝 `tests/Monolog/Formatter/WildfireFormatterTest.php` (+5 -5) _...and 4 more files_ </details> ### 📄 Description Fixes #736 - Uses DateTimeImmutable for everything - Added our own class extending it that means datetimes get serialized in json as `"Y-m-d\TH:i:s.uP"` or `"Y-m-d\TH:i:sP"` depending if microsecond precision is enabled. Feedback welcome :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:10:37 +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#1358
No description provided.