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

Pass the exception in the logger context #4886

Merged
merged 1 commit into from Nov 12, 2019

Conversation

tstauer
Copy link
Contributor

@tstauer tstauer commented Nov 11, 2019

Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets none
Related issues/PRs none
License MIT
Documentation PR none

What's in this PR?

Pass the exception in the FormatManager to the LoggerInterface.
https://www.php-fig.org/psr/psr-3/#13-context describes how it is done.
https://github.com/symfony/console/blob/master/EventListener/ErrorListener.php#L48 shows that symfony may pass an exception as context.

Why?

I want to ignore a MediaNotFoundException on a staging system.
Without passing the exception one has to interpret the error message string instead which is inconvenient and perhaps not reliable.

BC Breaks/Deprecations

The stack trace is no longer logged as context. One can get that from the exception instead.

To Do

  • Add breaking changes to UPGRADE.md?

@alexander-schranz alexander-schranz changed the base branch from master to release/2.0 November 11, 2019 21:13
@alexander-schranz
Copy link
Member

@tstauer thx for the pull request can you rebase your branch to release/2.0 branch?

@tstauer tstauer reopened this Nov 12, 2019
@tstauer
Copy link
Contributor Author

tstauer commented Nov 12, 2019

@alexander-schranz: I've updated the pull request.

@alexander-schranz alexander-schranz merged commit 9b99eb1 into sulu:release/2.0 Nov 12, 2019
@alexander-schranz
Copy link
Member

@tstauer thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants