After Aspect

Learn how to perform a task after an intercepted method call has been executed and what to do in case it throws an exception.

Logging is a cross-cutting concern for which aspects can be created. In this lesson, we will create another aspect that will log the values returned after the methods have been executed.

We will create an aspect in the io.datajek.springaop.movierecommenderaop.aspect package. Create a class named LoggingAspect and mark it with @Aspect and @Configuration annotations.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.