brandboat commented on code in PR #17382:
URL: https://github.com/apache/kafka/pull/17382#discussion_r1792717514
##########
core/src/test/scala/unit/kafka/utils/TestUtils.scala:
##########
@@ -1865,4 +1866,17 @@ object TestUtils extends Logging {
timedOut.set(true)
}
}
+
+ /**
+ * Resets the logging configuration after the test.
+ */
+ def resetLogging[T] = {
+ org.apache.log4j.LogManager.resetConfiguration()
+ val stream = this.getClass.getResourceAsStream("/log4j.properties")
+ try {
+ PropertyConfigurator.configure(stream)
+ } finally {
+ stream.close()
+ }
Review Comment:
Thanks for the input, @frankvicky. You're absolutely right—we should use the
method you suggested once we upgrade to log4j2. I appreciate you pointing that
out. If the log4j upgrade PR gets merged into trunk first, I'll make sure to
rebase my PR. Alternatively, if this PR is merged beforehand, I’d be happy to
help replace all instances of PropertyConfigurator.configure with
Configurator.reconfigure, if needed. (though I think the log4j2 upgrade part
should have been done all in once, but I can help submit patch for you if
needed)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]