Skip to content

Log appender hardening#298

Merged
krystian-panek-vmltech merged 5 commits intomainfrom
log-appender-hardening
Mar 10, 2026
Merged

Log appender hardening#298
krystian-panek-vmltech merged 5 commits intomainfrom
log-appender-hardening

Conversation

@krystian-panek-vmltech
Copy link
Collaborator

No description provided.

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 PR replaces the OSGi-service-based SlingLogInterceptor (which registered Logback appenders via Sling's AppenderTracker as OSGi services) with LogbackLogInterceptor, which directly attaches/detaches Logback appenders to individual loggers using reflection. The LogbackAppenderFactory is refactored from exposing low-level lifecycle methods to providing a higher-level attach/detach API, and a new isAvailable() check is moved into the factory.

Changes:

  • SlingLogInterceptor is removed and replaced by LogbackLogInterceptor, which directly attaches the Logback appender to individual loggers via reflection instead of relying on Sling's AppenderTracker OSGi mechanism.
  • LogbackAppenderFactory is refactored: constants made private, OSGi-related lifecycle methods removed, and new higher-level attach/detach/isAvailable methods added.
  • LogInterceptorManager has its class-level Javadoc removed (which referenced the now-deleted SlingLogInterceptor).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
SlingLogInterceptor.java Deleted entirely; replaced by the new LogbackLogInterceptor approach
LogbackLogInterceptor.java New OSGi component that directly attaches/detaches Logback appenders per-logger via LogbackAppenderFactory
LogbackAppenderFactory.java Refactored: constants privatized; new isAvailable, attach, detach methods; per-logger attach/detach helpers added
LogInterceptorManager.java Javadoc removed (contained stale reference to SlingLogInterceptor)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@krystian-panek-vmltech krystian-panek-vmltech merged commit cae611f into main Mar 10, 2026
1 check passed
@krystian-panek-vmltech krystian-panek-vmltech deleted the log-appender-hardening branch March 10, 2026 13:04
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.

2 participants