Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the log interception mechanism to remove direct dependencies on deprecated Logback internal classes (ch.qos.logback.*) in order to comply with AEM as a Cloud Service API deprecation warnings. The solution uses a reflection-based approach with the Sling Commons Log AppenderTracker mechanism, avoiding compile-time dependencies on Logback while maintaining the same functionality.
Changes:
- Introduced a new log interceptor architecture with
LogInterceptor,LogInterceptorManager,SlingLogInterceptor, and supporting classes - Refactored
CodePrintStreamto use the new log interceptor instead of direct Logback API calls - Removed deprecated Logback dependencies and added Sling Commons ClassLoader dependency
- Added Maven wrapper (mvnw) for build tooling
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/java/dev/vml/es/acm/core/code/log/LogInterceptor.java | Interface defining log interception contract |
| core/src/main/java/dev/vml/es/acm/core/code/log/LogInterceptorManager.java | OSGi component managing multiple log interceptor implementations |
| core/src/main/java/dev/vml/es/acm/core/code/log/LogMessage.java | Data transfer object for log messages |
| core/src/main/java/dev/vml/es/acm/core/code/log/SlingLogInterceptor.java | Implementation using Sling AppenderTracker with reflection-based Logback integration |
| core/src/main/java/dev/vml/es/acm/core/code/log/LogbackAppenderFactory.java | Factory creating Logback appenders via reflection to avoid compile-time dependencies |
| core/src/main/java/dev/vml/es/acm/core/code/CodePrintStream.java | Refactored to use LogInterceptorManager instead of direct Logback APIs |
| core/src/main/java/dev/vml/es/acm/core/code/ExecutionContext.java | Updated to inject LogInterceptorManager into CodePrintStream |
| core/src/test/java/dev/vml/es/acm/core/code/CodePrintStreamTest.java | Updated test calls to use new CodePrintStream constructor signature |
| core/pom.xml | Removed Logback dependencies, added Sling Commons ClassLoader, disabled Spotless formatting |
| aem/default/etc/aem.yml | Added NativeLogInterceptor to bundle exclusions |
| mvnw | Added Maven wrapper script with AEM Compose integration |
Comments suppressed due to low confidence (1)
core/pom.xml:93
- Spotless code formatting has been disabled with a TODO comment mentioning Java 21 compatibility. This change seems unrelated to the log interceptor feature and should either be addressed in this PR or tracked in a separate issue. Disabling formatting can lead to inconsistent code style across the codebase.
<java>
<includes>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/dev/vml/es/acm/core/code/log/SlingLogInterceptor.java
Show resolved
Hide resolved
core/src/main/java/dev/vml/es/acm/core/code/log/LogbackAppenderFactory.java
Outdated
Show resolved
Hide resolved
core/src/main/java/dev/vml/es/acm/core/code/log/SlingLogInterceptor.java
Show resolved
Hide resolved
core/src/main/java/dev/vml/es/acm/core/code/log/SlingLogInterceptor.java
Show resolved
Hide resolved
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.
fixes #208