opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.12k stars 1.01k forks source link

Add back GraphQL data fetcher error logging #5928

Closed vpaturet closed 1 week ago

vpaturet commented 1 week ago

Summary

GraphQL Java v22 removed support for logging errors in data fetchers (see https://github.com/graphql-java/graphql-java/pull/3403). This used to be controlled through the notprivacysafe.graphql logger. This PR adds back this feature by creating a custom DataFetcherExceptionHandler that logs at WARN level all errors thrown from data fetchers. This applies to the Transmodel API and the GTFS API.

The logger is disabled by default in the logback.xml file shipped with OTP (as was the case with notprivacysafe.graphql)

Issue

No

Unit tests

No

Documentation

No

vpaturet commented 1 week ago

@leonardehrenfried should this be configured in the GTFS API as well?

leonardehrenfried commented 1 week ago

Yes, we want it there, too. We could use a common logger name.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 69.45%. Comparing base (827684a) to head (8586376). Report is 5 commits behind head on dev-2.x.

Files Patch % Lines
...rt/graphql/LoggingDataFetcherExceptionHandler.java 50.00% 2 Missing :warning:
.../AbortOnUnprocessableRequestExecutionStrategy.java 0.00% 2 Missing :warning:
...entripplanner/apis/transmodel/TransmodelGraph.java 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev-2.x #5928 +/- ## ============================================= + Coverage 69.43% 69.45% +0.01% - Complexity 17065 17068 +3 ============================================= Files 1934 1935 +1 Lines 73606 73634 +28 Branches 7540 7539 -1 ============================================= + Hits 51109 51141 +32 + Misses 19870 19869 -1 + Partials 2627 2624 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.