Project

General

Profile

« Previous | Next » 

Revision dbdfb62b

Added by Andreas Kohlbecker over 2 years ago

ref #9236 better solution to solve the broken logging: disable the LogbackServletContainerInitializer per webapp init parameter

View differences:

src/main/java/eu/etaxonomy/cdm/server/Bootloader.java
51 51
import org.apache.log4j.Logger;
52 52
import org.apache.tomcat.SimpleInstanceManager;
53 53
import org.apache.tomcat.util.scan.StandardJarScanner;
54
import org.eclipse.jetty.annotations.AnnotationConfiguration;
55 54
import org.eclipse.jetty.apache.jsp.JettyJasperInitializer;
56 55
import org.eclipse.jetty.jmx.MBeanContainer;
57 56
import org.eclipse.jetty.plus.annotation.ContainerInitializer;
......
67 66
import org.eclipse.jetty.webapp.WebAppClassLoader;
68 67
import org.eclipse.jetty.webapp.WebAppContext;
69 68

  
69
import ch.qos.logback.core.CoreConstants;
70 70
import eu.etaxonomy.cdm.server.instance.CdmInstance;
71 71
import eu.etaxonomy.cdm.server.instance.Configuration;
72 72
import eu.etaxonomy.cdm.server.instance.InstanceManager;
......
765 765
        }
766 766

  
767 767
        // --- configure centralized logging
768
        // 1. remove the ch.qos.logback.classic.servlet.LogbackServletContainerInitializer to prevent from stopping the
768
        //
769
        // for details, please see eu.etaxonomy.cdm.server.logging.LoggingConfigurator
770
        //
771
        // 1. disable the ch.qos.logback.classic.servlet.LogbackServletContainerInitializer to prevent from stopping the
769 772
        //    logging context when one cdm webapp is being shut down (see https://dev.e-taxonomy.eu/redmine/issues/9236)
770
        //    --> exclude the ch.qos.logback.classic.servlet.LogbackServletContainerInitializer
771
        String regexEcludePattern = ".*LogbackServletContainerInitializer";
772
        cdmWebappContext.setAttribute(AnnotationConfiguration.SERVLET_CONTAINER_INITIALIZER_EXCLUSION_PATTERN, regexEcludePattern);
773
        cdmWebappContext.setInitParameter(CoreConstants.DISABLE_SERVLET_CONTAINER_INITIALIZER_KEY, "true");
773 774
        // 2. wrap the context with the InstanceLogWrapper and modify class path patterns
774 775
        Handler contextWithCentralizedLogging = loggingConfigurator.configureWebApp(cdmWebappContext, instance);
775 776

  

Also available in: Unified diff