![](/img/trans.png)
[英]How to get an email with log details when errors occur with Slim and Monolog
[英]Monolog email not received: how to debug
使用云主机时,不会收到Monolog在共享主机上发送的异常电子邮件。 主机是Azure Azure 16 VM。 在VM上安装了sendmail
,并接收到测试电子邮件。 VM上的parameters.yml
包含与共享主机相同的mailer_...
参数。
当强制执行“ CRITICAL: Uncaught PHP Exception Exception
时,产品日志中没有与电子邮件相关的条目。 自定义异常页面显示在错误上。
config_prod.yml包括:
monolog:
handlers:
mail:
type: fingers_crossed
action_level: critical
handler: deduplicated
deduplicated:
type: deduplication
handler: swift
swift:
type: swift_mailer
from_email: 'azure-mana@projectmana.org'
to_email: %mailer_user%
subject: 'An Error Occurred!'
level: debug
formatter: monolog.formatter.html
content_type: text/html
编辑:使用FOSUserBundle密码重置机制生成电子邮件,我得到的产品日志条目可能很重要。 使用mailer_...
parameters.yml
的用户名和密码,重置过程将产生:
严重:未捕获的PHP异常Swift_TransportException:“无法使用用户名在SMTP服务器上进行身份验证...
如果没有mailer...
条目mailer...
错误是:
预期的响应代码为250,但代码为“ 530”,消息为“ 530 5.7.0”,必须首先发出STARTTLS命令
但是我没有提到TLS的sendmail配置或需要身份验证。 如果我这样做了,我说这不是必需的。
我能想到的最好的一点是sendmail本身是不够的,或者我使用它的能力甚至还不够。 因此,我在顶部安装了postfix,未对postfix添加任何配置,重新启动,现在发送了异常电子邮件。 (并且收到,一旦我的电子邮件“获悉”它们不是垃圾邮件!)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.