-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Document usage of Symfony Mailer for error email #14360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,9 @@ | |
How to Configure Monolog to Email Errors | ||
======================================== | ||
|
||
.. caution:: | ||
.. versionadded:: 3.6 | ||
|
||
This feature is not compatible yet with the new :doc:`Symfony mailer </mailer>`, | ||
so it requires using SwiftMailer. | ||
Support for emailing errors using :doc:`Symfony mailer </mailer>` was added in MonologBundle 3.6. | ||
|
||
`Monolog`_ can be configured to send an email when an error occurs within an | ||
application. The configuration for this requires a few nested handlers | ||
|
@@ -33,9 +32,9 @@ it is broken down. | |
handler: deduplicated | ||
deduplicated: | ||
type: deduplication | ||
handler: swift | ||
swift: | ||
type: swift_mailer | ||
handler: symfony_mailer | ||
symfony_mailer: | ||
type: symfony_mailer | ||
from_email: '[email protected]' | ||
to_email: '[email protected]' | ||
# or list of recipients | ||
|
@@ -73,11 +72,11 @@ it is broken down. | |
<monolog:handler | ||
name="deduplicated" | ||
type="deduplication" | ||
handler="swift" | ||
handler="symfony_mailer" | ||
/> | ||
<monolog:handler | ||
name="swift" | ||
type="swift_mailer" | ||
name="symfony_mailer" | ||
type="symfony_mailer" | ||
from-email="[email protected]" | ||
subject="An Error Occurred! %%message%%" | ||
level="debug" | ||
|
@@ -114,10 +113,10 @@ it is broken down. | |
], | ||
'deduplicated' => [ | ||
'type' => 'deduplication', | ||
'handler' => 'swift', | ||
'handler' => 'symfony_mailer', | ||
], | ||
'swift' => [ | ||
'type' => 'swift_mailer', | ||
'symfony_mailer' => [ | ||
'type' => 'symfony_mailer', | ||
'from_email' => '[email protected]', | ||
'to_email' => '[email protected]', | ||
// or a list of recipients | ||
|
@@ -162,7 +161,7 @@ You can adjust the time period using the ``time`` option: | |
type: deduplication | ||
# the time in seconds during which duplicate entries are discarded (default: 60) | ||
time: 10 | ||
handler: swift | ||
handler: symfony_mailer | ||
|
||
.. code-block:: xml | ||
|
||
|
@@ -172,7 +171,7 @@ You can adjust the time period using the ``time`` option: | |
<monolog:handler name="deduplicated" | ||
type="deduplication" | ||
time="10" | ||
handler="swift"/> | ||
handler="symfony_mailer"/> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -184,12 +183,12 @@ You can adjust the time period using the ``time`` option: | |
'type' => 'deduplication', | ||
// the time in seconds during which duplicate entries are discarded (default: 60) | ||
'time' => 10, | ||
'handler' => 'swift', | ||
'handler' => 'symfony_mailer', | ||
], | ||
], | ||
]); | ||
|
||
The messages are then passed to the ``swift`` handler. This is the handler that | ||
The messages are then passed to the ``symfony_mailer`` handler. This is the handler that | ||
actually deals with emailing you the error. The settings for this are | ||
straightforward, the to and from addresses, the formatter, the content type | ||
and the subject. | ||
|
@@ -217,9 +216,9 @@ get logged on the server as well as the emails being sent: | |
level: debug | ||
deduplicated: | ||
type: deduplication | ||
handler: swift | ||
swift: | ||
type: swift_mailer | ||
handler: symfony_mailer | ||
symfony_mailer: | ||
type: symfony_mailer | ||
from_email: '[email protected]' | ||
to_email: '[email protected]' | ||
subject: 'An Error Occurred! %%message%%' | ||
|
@@ -259,11 +258,11 @@ get logged on the server as well as the emails being sent: | |
<monolog:handler | ||
name="deduplicated" | ||
type="deduplication" | ||
handler="swift" | ||
handler="symfony_mailer" | ||
/> | ||
<monolog:handler | ||
name="swift" | ||
type="swift_mailer" | ||
name="symfony_mailer" | ||
type="symfony_mailer" | ||
from-email="[email protected]" | ||
subject="An Error Occurred! %%message%%" | ||
level="debug" | ||
|
@@ -303,10 +302,10 @@ get logged on the server as well as the emails being sent: | |
], | ||
'deduplicated' => [ | ||
'type' => 'deduplication', | ||
'handler' => 'swift', | ||
'handler' => 'symfony_mailer', | ||
], | ||
'swift' => [ | ||
'type' => 'swift_mailer', | ||
'symfony_mailer' => [ | ||
'type' => 'symfony_mailer', | ||
'from_email' => '[email protected]', | ||
'to_email' => '[email protected]', | ||
// or a list of recipients | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.