[fix][functions] Fix flaky testJavaLoggingFunction
@@ -306,7 +306,6 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable {
}
}
- addLogTopicHandler();
JavaExecutionResult result;
// set last invocation time
@@ -327,8 +326,6 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable {
// register end time
stats.processTimeEnd();
- removeLogTopicHandler();
-
if (result != null) {
// process the synchronous results
handleResult(currentRecord, result);
@@ -703,15 +700,9 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable {
instanceConfig.getInstanceName());
logAppender.start();
setupLogTopicAppender(LoggerContext.getContext());
- }
- }
-
- private void addLogTopicHandler() {
- if (logAppender == null) {
- return;
- }
setupLogTopicAppender(LoggerContext.getContext(false));
}
+ }
private void setupLogTopicAppender(LoggerContext context) {
Configuration config = context.getConfiguration();
@@ -723,13 +714,6 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable {
context.updateLoggers();
}
- private void removeLogTopicHandler() {
- if (logAppender == null) {
- return;
- }
- removeLogTopicAppender(LoggerContext.getContext(false));
- }
-
private void removeLogTopicAppender(LoggerContext context) {
Configuration config = context.getConfiguration();
for (final LoggerConfig loggerConfig : config.getLoggers().values()) {
