Skip to content

[Mailer] Logger vs debug mailer #32583

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

Merged
merged 2 commits into from
Jul 18, 2019
Merged

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Jul 17, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Currently, there is no way to get the network data for the HTTP calls done by the HTTP transports (which makes debugging harder). For SMTP, we do have the network data, but as logs (each SMTP command/response is its own log line which means that the logs are "polluted" and the data is not tied with the sent message).

This pull request adds a getDebug() method on SentMessage. That allows to get the debug data conveniently in a standardized way (for both SMTP and HTTP transports). I have moved the SMTP logs to this new mechanism and added support for HTTP transports.

@nicolas-grekas nicolas-grekas added this to the next milestone Jul 17, 2019
@nicolas-grekas nicolas-grekas changed the title Logger vs debug mailer [Maile] Logger vs debug mailer Jul 17, 2019
@nicolas-grekas nicolas-grekas changed the title [Maile] Logger vs debug mailer [Mailer] Logger vs debug mailer Jul 17, 2019
@fabpot fabpot force-pushed the logger-vs-debug-mailer branch from 15c20c6 to b22dd6d Compare July 18, 2019 08:10
@fabpot fabpot force-pushed the logger-vs-debug-mailer branch from b22dd6d to 7acebce Compare July 18, 2019 08:18
@fabpot
Copy link
Member Author

fabpot commented Jul 18, 2019

Failures on high deps will be resolved when merging up.
Failures on low are not related.

@fabpot fabpot force-pushed the logger-vs-debug-mailer branch from 7acebce to fded3cd Compare July 18, 2019 12:34
@fabpot fabpot merged commit fded3cd into symfony:4.4 Jul 18, 2019
fabpot added a commit that referenced this pull request Jul 18, 2019
This PR was squashed before being merged into the 4.4 branch (closes #32583).

Discussion
----------

[Mailer] Logger vs debug mailer

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Currently, there is no way to get the network data for the HTTP calls done by the HTTP transports (which makes debugging harder). For SMTP, we do have the network data, but as logs (each SMTP command/response is its own log line which means that the logs are "polluted" and the data is not tied with the sent message).

This pull request adds a `getDebug()` method on `SentMessage`. That allows to get the debug data conveniently in a standardized way (for both SMTP and HTTP transports). I have moved the SMTP logs to this new mechanism and added support for HTTP transports.

Commits
-------

fded3cd [Mailer] added support ffor debug info when using SMTP
d2f33d2 [Mailer] added debug info for HTTP mailers
@fabpot fabpot deleted the logger-vs-debug-mailer branch July 18, 2019 20:17
fabpot added a commit that referenced this pull request Aug 3, 2019
…ce (fabpot)

This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] added debug info to TransportExceptionInterface

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | ~

In 4.4, you can get the debug information for the SMTP/HTTP data via `$message->getDebug()` (see #32583). But the data are probably even more important when there is an exception. That's what I implemented in this PR.

Commits
-------

39ebb84 [Mailer] added debug info to TransportExceptionInterface
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants