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

Exception not logged at DEBUG level when handled by annotated controller method #996

Closed
lukasGemela opened this issue Jun 14, 2024 · 0 comments
Assignees
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@lukasGemela
Copy link

lukasGemela commented Jun 14, 2024

Documentation states that:

Unresolved exception are logged at ERROR level along with the executionId to correlate to the error sent to the client. Resolved exceptions are logged at DEBUG level.

This might be true for DataFetcherExceptionResolverAdapter usage, but when we use annotated controllers with @GraphQlExceptionHandler, we see only this log:

2024-06-14 09:05:50.827 [http-nio-auto-1-exec-1] DEBUG o.s.g.d.m.a.s.AnnotatedControllerExceptionResolver - Handling exception with public java.util.List<graphql.GraphQLError> com.xxx.xxx.xxx.exception.GlobalExceptionHandler.handleValidationException(com.xxx.xxx.xxx.xxx.exception.ValidationException,graphql.schema.DataFetchingEnvironment)

I'd expect also AnnotatedControllerExceptionResolver to log resolved exceptions on debug level, not only their "handling"

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 14, 2024
@rstoyanchev rstoyanchev self-assigned this Jun 26, 2024
@rstoyanchev rstoyanchev added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 26, 2024
@rstoyanchev rstoyanchev added this to the 1.3.2 milestone Jun 26, 2024
@rstoyanchev rstoyanchev changed the title resolved exception is not logged Exception not logged at DEBUG level when handled by annotated controller method Jun 26, 2024
rstoyanchev added a commit that referenced this issue Jun 27, 2024
rstoyanchev added a commit that referenced this issue Jun 27, 2024
@rstoyanchev rstoyanchev added the for: backport-to-1.2.x Marks an issue as a candidate for backport to 1.2.x label Jul 15, 2024
@github-actions github-actions bot added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-1.2.x Marks an issue as a candidate for backport to 1.2.x labels Jul 15, 2024
rstoyanchev added a commit that referenced this issue Jul 15, 2024
rstoyanchev added a commit that referenced this issue Jul 15, 2024
This commit aligns DEBUG logging of exceptions resolved via annotated
exception handler methods with ExceptionResolversExceptionHandler and
the reference documentation.

Closes gh-996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants