Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Why relocate logback packages and configuration files #3531

Closed
yiliuTo opened this issue Jan 31, 2024 · 2 comments
Closed

[Question] Why relocate logback packages and configuration files #3531

yiliuTo opened this issue Jan 31, 2024 · 2 comments

Comments

@yiliuTo
Copy link
Member

yiliuTo commented Jan 31, 2024

I see the code in ai.shadow-conventions.gradle.kts relocates all loback related packages and configs. So I am confused what is the purpose of relocation and isolation of logback? IMO, since logback is imported in agent-tooling with all of its dependencies being loaded in the agent classloader, it won't bring conflicts with users' application or other agent dependencies.

val shadowPrefix = "com.microsoft.applicationinsights.agent.shadow"
relocate("ch.qos.logback", "$shadowPrefix.ch.qos.logback")
relocate("javax.annotation", "$shadowPrefix.javax.annotation")
// to prevent accidentally picking up from user's class path
relocate("logback.configurationFile", "applicationinsights.logback.configurationFile")
relocate("logback.xml", "applicationinsights.logback.xml")
relocate("logback.groovy", "applicationinsights.logback.groovy")
relocate("logback-test.xml", "applicationinsights.logback-test.xml")

@trask
Copy link
Member

trask commented Jan 31, 2024

hi @yiliuTo! I believe that you're right and relocation is no longer needed after #3190 (logback was originally in the bootstrap class loader which is why shading was needed before)

@yiliuTo
Copy link
Member Author

yiliuTo commented Jan 31, 2024

Thanks @trask for the explanation.

@yiliuTo yiliuTo closed this as completed Jan 31, 2024
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

No branches or pull requests

2 participants