How to do it...

Before implementing AOP components, let us first implement logging by following these steps:

  1. The previous has already created some POJOs, so just copy the Employee model, the supporting DAO and service interfaces, and their corresponding implementation classes. Place all model classes in a new package, org.packt.aop.transaction.model.data, all DAO components in org.packt.aop.transaction.dao, and all services in org.packt.aop.transaction.service.
  2. Add the updated Log4J libraries to the pom.xml:
<dependency> 
  <groupId>log4j</groupId> 
  <artifactId>log4j</artifactId> 
  <version>1.2.17</version> 
</dependency>
  1. Create the log4j.properties containing the needed configuration details such as the type of appenders to be used, message ...

Get Spring 5.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.