Class AppInit

java.lang.Object
fr.paris.lutece.portal.service.init.AppInit

public final class AppInit extends Object
This class initializes all the application services
Since:
1.1
  • Field Details

  • Method Details

    • initConfigLog

      public static void initConfigLog()
      Initializes the Log4j2 configuration by setting the `log4j.configurationFile` system property. This method should be called first, before any other components or libraries are initialized, to ensure that the Log4j logging system is properly configured. If the system property `log4j.configurationFile` is not already set, this method constructs the configuration file path using the default location or custom plugin log configuration files. The configuration file will be located at "/WEB-INF/conf/log.xml" by default, and it can include additional log configuration files specified by plugins. The constructed path will be set as the value for the `log4j.configurationFile` system property.

      Usage: Call this method at the very beginning of the application startup to ensure that Log4j is configured correctly before any logging occurs.

      See Also:
      • LogManager
    • initServices

      public static void initServices(String strConfPath)
      Initializes all the application services (used for junit tests)
      Parameters:
      strConfPath - The relative path to the config files
    • initServices

      public static void initServices(jakarta.servlet.ServletContext context, String strConfPath)
      Initializes all the application services
      Parameters:
      context - The servlet context
      strConfPath - The relative path to the config files
      strRealPath - The real path to the config files
    • isWebappSuccessfullyLoaded

      public static boolean isWebappSuccessfullyLoaded()
      Tells if Lutece Startup was successful
      Returns:
      True, if no error, otherwise false
    • isLog4jConfigurationFileSet

      public static boolean isLog4jConfigurationFileSet()
      Checks if the system property `log4j.configurationFile` is set. This property determines the configuration file used by Log4j.
      Returns:
      true if `log4j.configurationFile` is set, otherwise false.
    • getLoadingFailureCause

      public static String getLoadingFailureCause()
      Returns the cause of the startup failure
      Returns:
      the cause of the startup failure
    • getLoadingFailureDetails

      public static String getLoadingFailureDetails()
      Returns details of the startup failure
      Returns:
      details of the startup failure