Class AppInit
java.lang.Object
fr.paris.lutece.portal.service.init.AppInit
This class initializes all the application services
- Since:
- 1.1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the cause of the startup failurestatic StringReturns details of the startup failurestatic voidInitializes the Log4j2 configuration by setting the `log4j.configurationFile` system property.static voidinitServices(jakarta.servlet.ServletContext context, String strConfPath) Initializes all the application servicesstatic voidinitServices(String strConfPath) Initializes all the application services (used for junit tests)static booleanChecks if the system property `log4j.configurationFile` is set.static booleanTells if Lutece Startup was successful
-
Field Details
-
LOG4J_CONFIGURATION_FILE_PROPERTY
- See Also:
-
-
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
Initializes all the application services (used for junit tests)- Parameters:
strConfPath- The relative path to the config files
-
initServices
Initializes all the application services- Parameters:
context- The servlet contextstrConfPath- The relative path to the config filesstrRealPath- 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:
trueif `log4j.configurationFile` is set, otherwisefalse.
-
getLoadingFailureCause
Returns the cause of the startup failure- Returns:
- the cause of the startup failure
-
getLoadingFailureDetails
Returns details of the startup failure- Returns:
- details of the startup failure
-