-
Notifications
You must be signed in to change notification settings - Fork 163
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
Configure GraphQL-java's DataFetcherExceptionHandler
to reduce log noise
#1279
Comments
Do you mean configuring SLF4J to skip the Note that #1238 introduces a custom exception handler (that currently extends the default one). If needed we could indeed duplicate the code instead, it's just 4 lines if we don't log. |
@olim7t yes, it's not tons of code so maybe this is one case where we could just change it. I filed the graphql-java issue just in case; we could just use that later on. As to change, I was thinking of changing actual call to do some of:
Our test run gets about 73 of these failures and all so far seem ones where message itself has all the pertinent information. |
Quick note: graphql-java will have this improvement in release 18.0 (not yet released as of 04-Oct-2021): graphql-java/graphql-java#2569 (fixes graphql-java/graphql-java#2564) in which a new overridable method has been added:
allowing for changing the behavior |
Alas, there's STILL no new release with the fix to use.... 17.3 from September 2021 is the latest: https://mvnrepository.com/artifact/com.graphql-java/graphql-java |
But now 18.0 and 18.1 are out, see https://mvnrepository.com/artifact/com.graphql-java/graphql-java ! |
Fix waiting for CR. |
(note: see graphql-java/graphql-java#2564 for the issue on grapql-java side)
Currently failures to fetch data for GraphQL query will get both indicated to caller and automatically logged (possibly multiple times). In case of automated logging at WARN level we will also always get a (lengthy) stack trace. Unfortunately this logging is done by graphql-java default handler,
SimpleDataFetcherExceptionHandler
and cannot be easily changed -- while it's not a big class and we could copy-paste, it seems better to try to use and configure default handler here, if possible.An example of output (somewhat truncated):
This happens about ~70 times during our CI tests but also affects products logging (depending on how many failures of these types are triggered by clients).
The text was updated successfully, but these errors were encountered: