Question

I put my project on production server and try send email on error using this guide http://symfony.com/doc/current/cookbook/logging/monolog_email.html

Simple email normal pass from server by SwiftMailer, but error emails not send. I try set action_level to debug, remove buffer, but not works on any test errors.

I use last version symfony2 from master. What I do wrong?

monolog:
handlers:
    main:
        type:         fingers_crossed
        action_level: debug
        handler:      grouped
    grouped:
        type:    group
        members: [streamed, buffered]
    streamed:
        type:  stream
        path:  "%kernel.logs_dir%/%kernel.environment%.log"
        level: debug
    buffered:
        type:    buffer
        handler: swift
    swift:
        type:       swift_mailer
        from_email: error@audiocards.irev.ru
        to_email:   borzenkov@irev.ru
        subject:    An Error Occurred!
        level:      debug
Was it helpful?

Solution

The problem is the swiftmailer spool feature that is not flushed after the swift mailer handler sends the email. See https://github.com/symfony/symfony-standard/issues/425 for more details. This is definitely a bug and hopefully it can be fixed soon.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top