Hallo zusammen,
gibt es in Contao eine Möglichkeit critical Errors von PHP per Mail zu versenden?
Laut der Doku von Symfony, kann es mithilfe einer monolog.yaml-Datei konfiguriert werden (https://symfony.com/doc/4.4/logging/monolog_email.html).
Ich habe jetzt nun in *root*/config/packages/prod/ und in *root*/config/packages/dev/ eine molog.yaml mit dem folgenden Inhalt angelegt.
Code:
monolog:
handlers:
main:
type: fingers_crossed
action_level: critical
handler: grouped
grouped:
type: group
members: [streamed, deduplicated]
streamed:
type: stream
path: '%kernel.logs_dir%/%kernel.environment%.debug.log'
level: debug
deduplicated:
type: deduplication
handler: swift
swift:
type: swift_mailer
from_email: 'no-reply@xxxxxx.com'
to_email: ['xxxxxx@xxxxxx.com', 'xxxxxx2@xxxxxx.com']
subject: '[Error:Contao] %%message%%'
level: debug
formatter: monolog.formatter.html
content_type: text/html
Leider werden die log-Einträge trotzdem in %kernel.environment%.log' gespeichert und die Mails nicht versendet.
Hat jemand eine Idee was ich falsch mache und ob es überhaupt geht ?
Danke im Voraus
Lesezeichen