Before implementing AOP components, let us first implement logging by following these steps:
- 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.
- Add the updated Log4J libraries to the pom.xml:
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency>
- Create the log4j.properties containing the needed configuration details such as the type of appenders to be used, message ...