Home / Function/ initialize() — spring-boot Function Reference

initialize() — spring-boot Function Reference

Architecture documentation for the initialize() function in Log4J2LoggingSystem.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  d96e0984_c4d4_8c0c_f645_23c756d30e3c["initialize()"]
  412405e1_afb7_ef0a_b22d_5edc2df0b828["getLoggerContext()"]
  d96e0984_c4d4_8c0c_f645_23c756d30e3c -->|calls| 412405e1_afb7_ef0a_b22d_5edc2df0b828
  bd65415b_ebfc_9f8d_9700_abc5695489ca["isAlreadyInitialized()"]
  d96e0984_c4d4_8c0c_f645_23c756d30e3c -->|calls| bd65415b_ebfc_9f8d_9700_abc5695489ca
  d5a45f32_c776_3a3d_047f_0ffd69df1fe0["getLogger()"]
  d96e0984_c4d4_8c0c_f645_23c756d30e3c -->|calls| d5a45f32_c776_3a3d_047f_0ffd69df1fe0
  ec28bceb_afae_dbcc_dc04_34cec403ab77["getEnvironment()"]
  d96e0984_c4d4_8c0c_f645_23c756d30e3c -->|calls| ec28bceb_afae_dbcc_dc04_34cec403ab77
  36342d1c_c6ba_b9d2_e9db_1183cd793ff7["markAsInitialized()"]
  d96e0984_c4d4_8c0c_f645_23c756d30e3c -->|calls| 36342d1c_c6ba_b9d2_e9db_1183cd793ff7
  d9471ed1_e3ee_0678_4ca8_2a20dfb150bf["initialize()"]
  d96e0984_c4d4_8c0c_f645_23c756d30e3c -->|calls| d9471ed1_e3ee_0678_4ca8_2a20dfb150bf
  style d96e0984_c4d4_8c0c_f645_23c756d30e3c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java lines 237–256

	@Override
	public void initialize(LoggingInitializationContext initializationContext, @Nullable String configLocation,
			@Nullable LogFile logFile) {
		LoggerContext loggerContext = getLoggerContext();
		if (isAlreadyInitialized(loggerContext)) {
			return;
		}
		StatusConsoleListener listener = new StatusConsoleListener(Level.WARN);
		StatusLogger.getLogger().registerListener(listener);
		loggerContext.putObject(STATUS_LISTENER_KEY, listener);
		Environment environment = initializationContext.getEnvironment();
		if (environment != null) {
			loggerContext.putObject(ENVIRONMENT_KEY, environment);
			Log4J2LoggingSystem.propertySource.setEnvironment(environment);
			PropertiesUtil.getProperties().addPropertySource(Log4J2LoggingSystem.propertySource);
		}
		loggerContext.getConfiguration().removeFilter(FILTER);
		super.initialize(initializationContext, configLocation, logFile);
		markAsInitialized(loggerContext);
	}

Domain

Subdomains

Frequently Asked Questions

What does initialize() do?
initialize() is a function in the spring-boot codebase.
What does initialize() call?
initialize() calls 6 function(s): getEnvironment, getLogger, getLoggerContext, initialize, isAlreadyInitialized, markAsInitialized.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free