Merged
Conversation
…cts for error and execution handling Co-authored-by: Artur S <Artituis@users.noreply.github.com>
…f method arguments and signatures Co-authored-by: Artur S <Artituis@users.noreply.github.com>
Co-authored-by: Artur S <Artituis@users.noreply.github.com>
… context records for before and after execution
…cution and error logging
- Added Spring AOP dependency to build.gradle. - Removed obsolete AOP classes: AbstractAroundAspectHandler, AspectHandler, AspectAfterExecutionChain, AspectBeforeExecutionChain, AspectExecutionErrorChain. - Introduced new chains for method invocation and post-invocation aspects: MethodInvocationAspectExecutorChain, PostInvocationAspectExecutorChain. - Created context classes for method invocation and post-invocation: MethodInvocationContext, PostInvocationContext, and their implementations. - Implemented logging executors for post-invocation context: Log4jPostExecutor and ThrowableLogExecutor. - Updated DomainLogConfig to prepare for dynamic aspect configuration. - Removed deprecated logging aspects: LogAfterExecutionAspect, TelemetryAfterLogAspect, ArgsLogAspect, SignatureLogAspect, TelemetryBeforeLogAspect, LogBeforeExecutionAspect, LogExecutionErrorAspect, StackTraceLogAspect. - Cleaned up FolderLog class, removing its dependency on AOP chains.
…ains for improved AOP structure
…cutors; remove deprecated dynamic aspect configuration
…e proper formatting in application-dev.yml
…application-env.yml for improved configuration management
…ation and logging setup
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new Aspect-Oriented Programming (AOP) framework to improve logging and method invocation handling while also updating configuration, dependencies, and Docker setups.
- Added AOP interceptor and executor chain implementations to handle method invocation, post-invocation, and error logging.
- Upgraded Spring Boot and logging dependencies and enhanced environment and Docker configuration.
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| SimpleMethodInterceptorWithContextHandler.java | Adds an AOP interceptor with context handling and chaining of before, after, and error executor chains. |
| ThrowableLogExecutor.java | Implements exception logging using a Java text block for detailed error information. |
| PostTelemetryLogExecutor.java | Logs telemetry data including method execution times. |
| MethodSignatureLogExecutor.java | Logs method invocation signatures. |
| Log4jExecutor.java | Provides base functionality for Log4j-based aspect executors. |
| IdentifiableAspectExecutor.java, AspectExecutor.java | Define executor interfaces, enhancing the AOP chain’s modularity. |
| SimplePostInvocationContext.java, SimpleMethodInvocationContext.java | Encapsulate the context data for method invocations and their corresponding post-invocation processes. |
| AspectExecutorChain.java and its sub-classes | Establish the chain of responsibility for aspect executors. |
| build.gradle, Dockerfile, .env.example | Update dependency versions, add logging dependencies, and enhance configuration setups. |
…MethodInterceptorWithContextHandler
…cationContext and PostInvocationContext
…tryLogExecutor, and ThrowableLogExecutor
…ed null safety
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several significant updates, including configuration setup, dependency updates, and the addition of an Aspect-Oriented Programming (AOP) framework to enhance logging and method invocation handling. Below is a breakdown of the most important changes:
Configuration and Environment Setup:
.env.examplefile to define environment variables, including database, Keycloak, storage, and logging configurations. This provides a template for configuring the application environment.Dockerfileto include theSTORAGE_LOCATIONenvironment variable and ensure the storage directory is created and owned by the application user.Dependency Updates:
infrastructure/build.gradlefrom3.4.1to3.4.5and added dependencies forspring-aopandspring-boot-starter-log4j2. Additionally, excluded the default Spring Boot logging module (spring-boot-starter-logging). [1] [2]AOP Framework Implementation:
AspectExecutorChainand its concrete implementations (MethodInvocationAspectExecutorChainandPostInvocationAspectExecutorChain) to manage the execution chain of aspects. [1] [2] [3]MethodInvocationContext,PostInvocationContext, and their implementations) to encapsulate method invocation details and results. [1] [2] [3] [4] [5] [6]AspectExecutorand its specialized executors (Log4jExecutor,MethodSignatureLogExecutor,PostTelemetryLogExecutor, andThrowableLogExecutor) to log method signatures, execution time, and exceptions. [1] [2] [3] [4] [5] [6]These changes collectively enhance the application's configurability, logging capabilities, and modularity, particularly by leveraging AOP for better separation of concerns and centralized logging.