Skip to content

Sling log interceptor#290

Merged
krystian-panek-vmltech merged 10 commits intomainfrom
logback-deprecation-fix
Feb 5, 2026
Merged

Sling log interceptor#290
krystian-panek-vmltech merged 10 commits intomainfrom
logback-deprecation-fix

Conversation

@krystian-panek-vmltech
Copy link
Collaborator

fixes #208

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CodePrintStream to 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@krystian-panek-vmltech krystian-panek-vmltech merged commit b637252 into main Feb 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AEMaaCS APIs deprecations

1 participant