Decorate spring boot repository

Viewed 868

I'm working on a Spring Boot API that's supposed to be deployed later this month. We created our own interface for a repository, and extended the CrudRepository. Spring boot autowires everything.

What I would like to do is add more logging capabilities, such as LOGGER.info("searched for solution ID").

Currently our code looks like this:

@Repository
public interface ProductSolutionRepository extends CrudRepository<ProductSolution, String> {

    public List<ProductSolution> findBySolutionId(@Param("solutionId") int solutionId);

Since Spring configures everything don't really see a way of decorating these functions to add logging functionality. Can someone help me out by pointing me to the documentation, showing a nice example, or explaining the concept behind logging decorators?

2 Answers
Related