Conversation
|
If you put this in the parent pom, in the dependencies section (not dependencyManagement), then I believe that each module will automatically inherit it. Just thinking that we could make the change in one place. |
|
Would the proper scope still be test - or is provided more appropriate - it needs to make it to the class paths for tests - not sure what is required for "normal" logging |
|
I tested with the |
|
So, I added the following to the parent pom: and removed the dependency declaration in |
|
What I first noticed was when running a test in an ide - the warning about it missing and using SimpleLogger was printed - but no logs showed up in the ide run pane |
Yes, I had the same issue in |
|
Moving the declaration to main pom.xml with test scope seems to work for logging in the IDE and |
|
Did you mean to add |
|
|
test/pom.xml
Outdated
| <dependency> | ||
| <groupId>org.apache.logging.log4j</groupId> | ||
| <artifactId>log4j-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> |
There was a problem hiding this comment.
This should already be on the class path. It's brought in transitively through accumulo-monitor, and we shouldn't have any direct dependencies on it, only transitive runtime dependencies on it. The test module has a direct dependency on the accumulo-monitor.
Ultimately, this should be fixed by 2.19.1, which should re-add the transitive dependency for log4j-slf4j2-impl (https://issues.apache.org/jira/browse/LOG4J2-3601), but it hasn't been done yet, and some of the devs seemed confused about why they needed to fix that. So, I don't know when it will happen.
If this helps fix something during testing in an IDE, I'm fine with adding it. It's not going to hurt.
|
The current version of this change doesn't actually solve anything because as @ctubbsii pointed out the dependency is already transitive from accumulo-monitor. I can see the dependency is pulled in transitively both in Intellij and the command line and running tests from the test module from Intellij logging is working fine in the However, where I do see a problem is other modules. For example, running BulkImporterTest doesn't have logging as there is not longer a transitive dependency on log4j-core for I will go through and update the PR and push a commit to fix this. |
Due to https://issues.apache.org/jira/browse/LOG4J2-3601 we need to add log4j-core to all modules that have a test dependency on log4j-slf4j2-impl, but not a dependency on accumulo-monitor, as log4j-slf4j2-impl no longer has a runtime dependency on log4j-core.
|
This has been fixed with my latest commit. Essentially, due to the bug, we have to add a test scope dependency for |
Updates to log4j versions require log4j-core to be present for test logging.