mirror of https://github.com/apache/nifi.git
NIFI-9688 Improve Logback shutdown handling (#5805)
* NIFI-9688 Improved Logback shutdown handling - Added environment variable to disable Logback shutdown on web application termination - Added shutdown hook to Logback configuration - Added Logback shutdown hook configuration to system tests
This commit is contained in:
parent
ddecfa201b
commit
52f21390db
|
@ -50,6 +50,9 @@ export NIFI_PID_DIR
|
|||
NIFI_LOG_DIR="$(setOrDefault "$NIFI_LOG_DIR" "$NIFI_HOME/logs")"
|
||||
export NIFI_LOG_DIR
|
||||
|
||||
# Disable automatic Logback Initializer to avoid shutdown on web application termination
|
||||
export logbackDisableServletContainerInitializer="true"
|
||||
|
||||
# Set to false to force the use of Keytab controller service in processors
|
||||
# that use Kerberos. If true, these processors will allow configuration of keytab
|
||||
# and principal directly within the processor. If false, these processors will be
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
-->
|
||||
|
||||
<configuration scan="true" scanPeriod="30 seconds">
|
||||
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
|
||||
|
||||
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
|
||||
<resetJUL>true</resetJUL>
|
||||
</contextListener>
|
||||
|
|
|
@ -95,9 +95,9 @@ public class ApplicationStartupContextListener implements ServletContextListener
|
|||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
logger.info("Initiating shutdown of flow service...");
|
||||
logger.info("Flow Service shutdown started");
|
||||
shutdown();
|
||||
logger.info("Flow service termination completed.");
|
||||
logger.info("Flow Service shutdown completed");
|
||||
}
|
||||
|
||||
private void shutdown() {
|
||||
|
|
|
@ -30,3 +30,6 @@ java.arg.14=-Djava.awt.headless=true
|
|||
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8002
|
||||
|
||||
java.arg.nodeNum=-DnodeNumber=1
|
||||
|
||||
# Disable Logback web shutdown hook using System property
|
||||
java.arg.logbackShutdown=-DlogbackDisableServletContainerInitializer=true
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
-->
|
||||
|
||||
<configuration scan="true" scanPeriod="30 seconds">
|
||||
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
|
||||
|
||||
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
|
||||
<resetJUL>true</resetJUL>
|
||||
</contextListener>
|
||||
|
|
|
@ -30,3 +30,6 @@ java.arg.14=-Djava.awt.headless=true
|
|||
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8003
|
||||
|
||||
java.arg.nodeNum=-DnodeNumber=2
|
||||
|
||||
# Disable Logback web shutdown hook using System property
|
||||
java.arg.logbackShutdown=-DlogbackDisableServletContainerInitializer=true
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
-->
|
||||
|
||||
<configuration scan="true" scanPeriod="30 seconds">
|
||||
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
|
||||
|
||||
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
|
||||
<resetJUL>true</resetJUL>
|
||||
</contextListener>
|
||||
|
|
|
@ -28,3 +28,6 @@ java.arg.3=-Xmx512m
|
|||
java.arg.14=-Djava.awt.headless=true
|
||||
|
||||
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8002
|
||||
|
||||
# Disable Logback web shutdown hook using System property
|
||||
java.arg.logbackShutdown=-DlogbackDisableServletContainerInitializer=true
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
-->
|
||||
|
||||
<configuration scan="true" scanPeriod="30 seconds">
|
||||
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
|
||||
|
||||
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
|
||||
<resetJUL>true</resetJUL>
|
||||
</contextListener>
|
||||
|
|
Loading…
Reference in New Issue