-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Hack DayLoggeractionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)hasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.
Description
Suggested updates to http://symfony.com/doc/2.8/cookbook/logging/monolog_email.html according to the last release of monolog https://github.com/Seldaek/monolog/releases/tag/1.19.0, and overall best practices (IMO).
# app/config/config_prod.yml
monolog:
handlers:
mail:
type: fingers_crossed
#500 errors are logged at the critical level
action_level: critical
# to also log 400 level errors (but not 404's):
# action_level: error
# excluded_404s:
# - ^/
handler: deduplicated
deduplicated:
type: deduplication
handler: swift
swift:
type: swift_mailer
from_email: '[email protected]'
to_email: '[email protected]'
# or list of recipients
# to_email: ['[email protected]', '[email protected]', ...]
subject: 'An Error Occurred! %%message%%'
level: debug
formatter: monolog.formatter.html
content_type: text/html
Namely this switches to the new deduplication handler, adds the message to the email subject, and formats the emails nicely with the html formatter (which is very valuable IMO for readability, and adds full stack traces and so on).
saidul, ypereirareis, pvsiv and ThePeterMick
Metadata
Metadata
Assignees
Labels
Hack DayLoggeractionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)hasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.