W 有 web-app,用 symfony-flex 构建。对于部署,我使用capistrano。对于记录关键日志,我以这种方式配置了独白:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
channels: ['!translation']
excluded_http_codes: [{ 404: ['^/security/login'] }]
handler: grouped
grouped:
type: group
members: [deduplicated]
deduplicated:
type: deduplication
handler: swift
swift:
type: swift_mailer
from_email: '%mailer_user%'
to_email: ['email1@gmail.com', 'email2@gmail.com']
subject: " %%level_name%% %%level%%"
level: info
formatter: monolog.formatter.html
content_type: text/html
SwiftMailer 配置:
swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }
除了每次发布后的日志外,一切正常。我收到了以前发送的旧日志。例子:
也许我错过了配置中的一些东西?