GithubHelp home page GithubHelp logo

Logger log doubles about swiftmailer-bundle HOT 3 CLOSED

symfony avatar symfony commented on July 26, 2024 1
Logger log doubles

from swiftmailer-bundle.

Comments (3)

hanneskaeufler avatar hanneskaeufler commented on July 26, 2024

I get some weird behaviour after updating to symfony 2.4 in which a test of mine fails because the SwiftMailer Message Collector also registers two messages sent were only one was actually sent.

from swiftmailer-bundle.

TrickyC94 avatar TrickyC94 commented on July 26, 2024

I've just noticed this behaviour too (v2.6.7). I tried to reproduce what happened under the hood.

  1. I call $mailer->send($message)
  2. The mailer calls $this->_transport->send($message) where _transport is a SpoolTransport instance
  3. The SpoolTransport dispatches the "beforeSendPerformed" event
  4. Logger is subscribed to that event and log once
  5. Symfony dispatches the "kernel.terminate" event
  6. The EmailSenderListner is subscribed to that event and it calls $spool->flushQueue($realTransport) in my case $spool is MemorySpool and the real transport now is the NullTransport
  7. The flushQueue method calls the send method on NullTransport
  8. NullTransport dispatches the "beforeSendPerformed"
  9. Logger is subscribed to that event and logs twice

@fabpot I think that this behaviour needs to be reviewed somehow, or, if this is the expected behaviour, to update the docs

from swiftmailer-bundle.

fabpot avatar fabpot commented on July 26, 2024

Closing old issues.

from swiftmailer-bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.