Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collecting Data not getting messages... #11

Open
Ninir opened this issue Jul 18, 2014 · 15 comments
Open

Collecting Data not getting messages... #11

Ninir opened this issue Jul 18, 2014 · 15 comments

Comments

@Ninir
Copy link

Ninir commented Jul 18, 2014

Hi guys!

While implementing Stampie for a given project, I faced the case where the DataCollector was not getting messages from the MessageLogger.

I overrided MessageLogger and StampieDataCollector in order to add a logger service.

The MessageLogger:preSend is well called, as far as I saw in my logs. When logging data from the DataCollector:collect, it seems there are no messages... Should I do something specific here?

Thanks for your time and help!

@henrikbjorn
Copy link
Contributor

Did you reenable StampieExtra? It uses the events from the extra functionality to log message.

This could be improved by decorating the mailer.

@stof
Copy link
Member

stof commented Jul 18, 2014

@henrikbjorn decorating the mailer is exactly what StampieExtra does :)

@henrikbjorn
Copy link
Contributor

@stof yeah, should really get those things merged together :)

@Ninir
Copy link
Author

Ninir commented Jul 18, 2014

@henrikbjorn Still active yes :/

The MessageLogger:preSend is well called, and I do have the debug line in my logs:

sprintf('Sending an email from "%s" to "%s"', IdentityUtils::buildIdentityString($message->getFrom()), IdentityUtils::buildIdentityString($message->getTo())),

This is my timeline at the moment:

// Logs added in the MessageLogger:preSend method
[2014-07-18 16:32:20] app.ERROR: Adding a message in the message logger [] []
[2014-07-18 16:32:20] app.ERROR: Messages before addition: 0 [] []
[2014-07-18 16:32:20] app.ERROR: Messages after addition: 1 [] []

Then I logged the StampieDataCollector:collect method.

[2014-07-18 16:32:21] app.INFO: Message logger is not null [] []
[2014-07-18 16:32:21] app.INFO: Messages in the logger: 0 [] []

So the first logs are displayed first in the timeline, then the collect method is called many times, but always at 0.

@henrikbjorn
Copy link
Contributor

@Ninir where in you application do you send the messages? Are you using the SpoolMailer?

@Ninir
Copy link
Author

Ninir commented Jul 18, 2014

@henrikbjorn Right from a controller, and the kernel.terminate is well called. However, it happens even in a command, in a listener, etc. :/

Not sure where the issue comes from tbh.

@stof
Copy link
Member

stof commented Jul 18, 2014

if you use the spool mailer, the collector will indeed run too early (recent Symfony versions have a way to fix this, but it would break compatibility with older Symfony versions)

@stof
Copy link
Member

stof commented Jul 18, 2014

and in a command, the profiler does not run at all.

@Ninir
Copy link
Author

Ninir commented Jul 18, 2014

@stof How do you think we could handle it for a given project? This feature is an interesting one but not usable atm.

I do am using the SpoolMailer :/

@stof
Copy link
Member

stof commented Jul 18, 2014

The issue is that 2.3 does not have the LateDataCollectorInterface (it is a 2.4 feature) and we cannot drop compatibility with 2.3 (it is the LTS).

I will look at a way to use the late collecting for 2.4+ with a fallback to the current way for 2.3 (so that 2.4+ gets the data for messages sent in kernel.terminate as well). but only after my vacations (I'm leaving for 2 weeks)

@Ninir
Copy link
Author

Ninir commented Jul 18, 2014

@stof Ok perfect, thanks for this! ;)

@henrikbjorn
Copy link
Contributor

When can we drop 2.3 support?

@Ninir
Copy link
Author

Ninir commented May 31, 2015

I would say now since 2.7 is the new LTS. However, 2.3 Will be maintained until may, 2016.

Le 31 mai 2015 à 17:48, Henrik Bjørnskov [email protected] a écrit :

When can we drop 2.3 support?


Reply to this email directly or view it on GitHub.

@henrikbjorn
Copy link
Contributor

Then lets do that, i dont really care for supporting an old LTS. Also lets just tag a new major anyway.

@Ninir
Copy link
Author

Ninir commented Jun 1, 2015

@henrikbjorn Sure, would be awesome :)
Thank you for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants