[GH-ISSUE #201] Infinit loop when use NormalizerFormatter with infinit Traversable obj #67

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

Originally created by @bronze1man on GitHub (Jun 7, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/201

I enter a Infinit loop when use NormalizerFormatter with infinit Traversable obj.
NormalizerFormatter::normalize will travel through all item in it.
I think NormalizerFormatter::normalize should travel through first 10 items.
May be I should not use Traversable interface on some obj with infinit items?

Originally created by @bronze1man on GitHub (Jun 7, 2013). Original GitHub issue: https://github.com/Seldaek/monolog/issues/201 I enter a Infinit loop when use NormalizerFormatter with infinit Traversable obj. NormalizerFormatter::normalize will travel through all item in it. I think NormalizerFormatter::normalize should travel through first 10 items. May be I should not use Traversable interface on some obj with infinit items?
kerem closed this issue 2026-03-04 02:11:53 +03:00
Author
Owner

@Seldaek commented on GitHub (Jun 7, 2013):

The question is indeed at which point do we stop. 10 items sounds not enough, 100 is probably good enough for most usages, but it might bother someone else. I'll patch it to stop at 1000 items for now, which should at least resolve your infinite loop problem. That said yeah I am not sure if giving an infinite item to the log is a great idea :) Maybe you could normalize it upfront if you know about it.

<!-- gh-comment-id:19094814 --> @Seldaek commented on GitHub (Jun 7, 2013): The question is indeed at which point do we stop. 10 items sounds not enough, 100 is probably good enough for most usages, but it might bother someone else. I'll patch it to stop at 1000 items for now, which should at least resolve your infinite loop problem. That said yeah I am not sure if giving an infinite item to the log is a great idea :) Maybe you could normalize it upfront if you know about it.
Author
Owner

@bronze1man commented on GitHub (Jun 11, 2013):

thanks.

<!-- gh-comment-id:19262272 --> @bronze1man commented on GitHub (Jun 11, 2013): thanks.
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#67
No description provided.