Open lcavadas opened 4 months ago
Seems like a good idea but needs tests
@graemerocher Added tests for the usual suspects (CRUD) and also added a test for @Query
annotated methods.
I wonder if it makes sense to instrument the DataSource
rather than the repository implementation //cc @dstepanov @radovanradic
That would require introspecting statements. We have some other issue requesting combining parameters binding logging with the query, so maybe this can be combined.
good point, but we should probably at least enhance JdbcOperations
to log no?
What do you mean by enhance?
@dstepanov I took a peek at that other issue you mentioned and while this mechanism would definitely work for that we would need to add some sort of trigger/done function to the observers in order to perform the actual logging. As I am not that familiar with this codebase I am unsure of where that trigger should actually happen. That said I'm happy to add it if you point me in the general direction of where you think it would be best to do it.
Externalising the QUERY_LOG as an observer so the same mechanism can be used for adding the query information to Spans (tracing)