mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #48] Monolog swiftmailer handler sends one mail per log entry #12
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @olegstepura on GitHub (Nov 15, 2011).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/48
with this configuration:
seems like swiftmailer is used to send one log line per message. That is really a bad idea since
Swiftmailer handler must have some buffer to send multiple messages per mail.
@see https://groups.google.com/forum/#!topic/symfony-devs/IZ4a_-Oyt2c
@stof commented on GitHub (Nov 15, 2011):
Simply wrap it in the BufferHandler. It is exactly what it is for.
The reason why it is in a separate handler is that it allows you to buffer other handlers as well without duplicating the logic.
@olegstepura commented on GitHub (Nov 15, 2011):
Can you please give an example for symfony configuration?
@stof commented on GitHub (Nov 15, 2011):
Note that I kept the FingersCrossedHandler wrapping the BufferHandler so that you get a mail only when an error occurs.
@Seldaek commented on GitHub (Nov 15, 2011):
Right, I guess the mail handler shouldn't be fixed directly, but adding this example to the docs (here and/or as a symfony cookbook) would be nice.
@olegstepura commented on GitHub (Nov 15, 2011):
Cool, thanks, it worked! And yes, that definitely must be described in a cookbook article (maybe in "How to use Monolog to write Logs").
Thanks again!