Class Log4jServletContainerInitializer

java.lang.Object
org.apache.logging.log4j.web.Log4jServletContainerInitializer
All Implemented Interfaces:
jakarta.servlet.ServletContainerInitializer

public class Log4jServletContainerInitializer extends Object implements jakarta.servlet.ServletContainerInitializer
In a Servlet 3.0 or newer environment, this initializer is responsible for starting up Log4j logging before anything else happens in application initialization. For consistency across all containers, if the effective Servlet major version of the application is less than 3.0, this initializer does nothing.
  • Constructor Details

    • Log4jServletContainerInitializer

      public Log4jServletContainerInitializer()
  • Method Details

    • onStartup

      public void onStartup(Set<Class<?>> classes, jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException
      Specified by:
      onStartup in interface jakarta.servlet.ServletContainerInitializer
      Throws:
      jakarta.servlet.ServletException