Skip to content

Add debug logs for successful resource loading in Loader#4060

Merged
vy merged 4 commits intoapache:2.xfrom
ban-xiu:add-loader-log
Mar 16, 2026
Merged

Add debug logs for successful resource loading in Loader#4060
vy merged 4 commits intoapache:2.xfrom
ban-xiu:add-loader-log

Conversation

@ban-xiu
Copy link
Contributor

@ban-xiu ban-xiu commented Mar 6, 2026

Close #4058

@markyag-spgdji
Copy link

We could rewrite getResourceAsStream in terms of getResource, and then get the stream via url.openStream(). Note that this is what java.lang.ClassLoader itself does. The benefit is that we log locations for BOTH methods.

@vy
Copy link
Member

vy commented Mar 16, 2026

We could rewrite getResourceAsStream in terms of getResource, and then get the stream via url.openStream(). Note that this is what java.lang.ClassLoader itself does. The benefit is that we log locations for BOTH methods.

@markyag-spgdji, correct, but this will not work for custom ClassLoader implementations which implement getResourceAsStream differently. Am I mistaken?

@vy vy self-assigned this Mar 16, 2026
@vy vy added the enhancement Additions or updates to features label Mar 16, 2026
Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

@ban-xiu, would you mind adding a changelog entry file too, please?

@github-project-automation github-project-automation bot moved this to Changes requested in Log4j pull request tracker Mar 16, 2026
@ban-xiu
Copy link
Contributor Author

ban-xiu commented Mar 16, 2026

@ban-xiu, would you mind adding a changelog entry file too, please?

done.

@github-project-automation github-project-automation bot moved this from Changes requested to Approved in Log4j pull request tracker Mar 16, 2026
@vy vy changed the title Add debug logs for successful resource loading in Loader Add debug logs for successful resource loading in Loader Mar 16, 2026
@vy vy enabled auto-merge (squash) March 16, 2026 15:12
@vy vy merged commit c5396fc into apache:2.x Mar 16, 2026
9 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Log4j pull request tracker Mar 16, 2026
@github-actions
Copy link

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

@markyag-spgdji
Copy link

thanks, both of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Additions or updates to features

Projects

Development

Successfully merging this pull request may close these issues.

loader should log where it found config files

3 participants