cameronlee314 commented on a change in pull request #1047: SAMZA-2210: Initial
majority migration for injecting classloader when doing reflection
URL: https://github.com/apache/samza/pull/1047#discussion_r290061773
##########
File path:
samza-log4j/src/main/java/org/apache/samza/logging/log4j/StreamAppender.java
##########
@@ -300,7 +300,8 @@ protected void setupSystem() {
String systemFactoryName = log4jSystemConfig.getSystemFactory(systemName)
.orElseThrow(() -> new SamzaException(
"Could not figure out \"" + systemName + "\" system factory for
log4j StreamAppender to use"));
- SystemFactory systemFactory = Util.getObj(systemFactoryName,
SystemFactory.class);
+ SystemFactory systemFactory =
Review comment:
`getClass().getClassLoader()` needs to return the plugin classloader for
this to work. So `StreamAppender` needs to be created by the plugin classloader.
I thought I had an understanding around how the logging classloaders worked,
but looking again at my notes, I was focusing on log4j, not necessarily slf4j
on top of log4j. I will need to do a few more experiments to ensure that
`StreamAppender` gets created correctly.
In any case, for this PR, there should be no impact, since it should be the
same classloader as before.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services