This repository demonstrates how to create and use a custom annotation in a Spring Boot application. The custom annotation @LogExecutionTime
is used to measure and log the execution time of methods, leveraging Spring's Aspect-Oriented Programming (AOP) capabilities.
- Define custom annotations for reusable logic.
- Implement an aspect for method execution time logging.
- Example integration with a Spring Boot service and REST controller.
The @LogExecutionTime
annotation can be applied to any method, and it will automatically log the execution time of that method without modifying its business logic.
-
Custom Annotation
- Annotation:
@LogExecutionTime
- Scope: Method-level.
- Annotation:
-
Aspect
- Logs the execution time of annotated methods using Spring AOP.
-
Example Application
- A sample service and REST controller demonstrate the usage of the custom annotation.
- Clone the repository:
git clone https://github.com/Nuraj250/spring-boot-custom-annotation.git