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

IBX-5027: Added logging exceptions for REST #45

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

Steveb-p
Copy link
Contributor

@Steveb-p Steveb-p commented Feb 6, 2023

Question Answer
JIRA issue IBX-5027
Type improvement
Target version v4.4
BC breaks no
Tests pass yes
Doc needed no

Our REST API does not log exceptions when they occur, making it harder to debug requests.

While it is possible to read stacktrace in th REST response, it is cumbersome and requires response to actually remain somewhere (which might not always be the case).

Instead, I suggest we log exceptions in a similar fashion as built-in Symfony's ErrorListener service does it.

Ideally, we would simply allow ErrorListener to run and log exceptions this way (it registers itself with priority 0 and -128, for logging and generating response respectively), but that would be a BC break on our side, because we would need to change several service priorities - which might mess up our users configurations, if they rely on us having exception listeners with specific priorities.

Currently:
image
I would expect to have instead:
image

TODO:

  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@konradoboza konradoboza requested a review from a team February 6, 2023 13:48
@sonarcloud
Copy link

sonarcloud bot commented Feb 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Steveb-p Steveb-p merged commit 3215715 into main Feb 6, 2023
@Steveb-p Steveb-p deleted the ibx-5027-log-exceptions branch February 6, 2023 15:20
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.

None yet

5 participants