log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java [51:70]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void contextInitialized(final ServletContextEvent event) {
        this.servletContext = event.getServletContext();
        LOGGER.debug("Log4jServletContextListener ensuring that Log4j starts up properly.");

        if ("true".equalsIgnoreCase(servletContext.getInitParameter(
                Log4jWebSupport.IS_LOG4J_AUTO_SHUTDOWN_DISABLED))) {
            throw new IllegalStateException("Do not use " + getClass().getSimpleName() + " when "
                    + Log4jWebSupport.IS_LOG4J_AUTO_SHUTDOWN_DISABLED + " is true. Please use "
                    + Log4jShutdownOnContextDestroyedListener.class.getSimpleName() + " instead of "
                    + getClass().getSimpleName() + ".");
        }

        this.initializer = WebLoggerContextUtils.getWebLifeCycle(this.servletContext);
        try {
            this.initializer.start();
            this.initializer.setLoggerContext(); // the application is just now starting to start up
        } catch (final IllegalStateException e) {
            throw new IllegalStateException("Failed to initialize Log4j properly.", e);
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



log4j-jakarta-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java [51:70]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void contextInitialized(final ServletContextEvent event) {
        this.servletContext = event.getServletContext();
        LOGGER.debug("Log4jServletContextListener ensuring that Log4j starts up properly.");

        if ("true".equalsIgnoreCase(servletContext.getInitParameter(
                Log4jWebSupport.IS_LOG4J_AUTO_SHUTDOWN_DISABLED))) {
            throw new IllegalStateException("Do not use " + getClass().getSimpleName() + " when "
                    + Log4jWebSupport.IS_LOG4J_AUTO_SHUTDOWN_DISABLED + " is true. Please use "
                    + Log4jShutdownOnContextDestroyedListener.class.getSimpleName() + " instead of "
                    + getClass().getSimpleName() + ".");
        }

        this.initializer = WebLoggerContextUtils.getWebLifeCycle(this.servletContext);
        try {
            this.initializer.start();
            this.initializer.setLoggerContext(); // the application is just now starting to start up
        } catch (final IllegalStateException e) {
            throw new IllegalStateException("Failed to initialize Log4j properly.", e);
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



