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

Improve Exception Logging in ExceptionResolversExceptionHandler #336

Closed
alexbudarov opened this issue Mar 22, 2022 · 1 comment
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@alexbudarov
Copy link

As I understand, currently developer has to set this application settting:

logging.level.org.springframework.graphql.execution.ExceptionResolversExceptionHandler = debug

if he/she wants to log unexpected exceptions from annotated handler methods.

By default (e.g. in spring-graphql sample apps) exceptions are not written to log .
Is it how it's intended to be? I would expect unexpected application errors to be written to log by default.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 22, 2022
@rstoyanchev rstoyanchev self-assigned this Apr 13, 2022
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 13, 2022
@rstoyanchev rstoyanchev added this to the 1.0.0-RC1 milestone Apr 13, 2022
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Apr 13, 2022

Thanks for the question, this can be improved as follows.

If the exception is resolved by a DataFetcherExceptionResolver it is logged with a stack trace at DEBUG level. If the exception is unresolved, in which case default handling as as internal error applies, then it is logged with a stack trace at ERROR level.

I think this is what you expect as well but if not please comment.

@rstoyanchev rstoyanchev changed the title Exception logging - default behavior Improve Exception Logging in ExceptionResolversExceptionHandler Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants