Skip to content

🚀 Add AOP-based Logging for Method Entry & Exit in Spring Boot Application #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

faizakram
Copy link
Owner

Overview

This PR introduces application-wide logging using Spring AOP to track method executions within the com.app package. The implementation ensures better visibility into method calls, arguments, and return values.

Changes Introduced

  • ✅ Added @Aspect-based logging in ApplicationLogging class.
  • ✅ Implemented @Pointcut to capture method executions across the application while excluding configuration classes.
  • ✅ Used @Before and @AfterReturning to log method entry and exit.
  • ✅ Integrated Lombok's @Log4j2 for structured logging.

Why this is needed?

  • Improves observability by providing logs for method calls and returned values.
  • Helps with debugging and monitoring application behavior in real-time.

How to Test?

  1. Run the Spring Boot application.
  2. Invoke any method in the com.app package.
  3. Check the application logs for structured method execution details.

@faizakram faizakram added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants