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

log4jLevelsArePropagatedToJul() — spring-boot Function Reference

Architecture documentation for the log4jLevelsArePropagatedToJul() function in Log4J2LoggingSystemTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  e617004e_5537_10df_c4ff_d3a07988283d["log4jLevelsArePropagatedToJul()"]
  bffa5cc2_2336_d219_9e81_a81a831f09b1["initialize()"]
  e617004e_5537_10df_c4ff_d3a07988283d -->|calls| bffa5cc2_2336_d219_9e81_a81a831f09b1
  24c0fbca_1c0a_587d_aae0_6001704c3181["getLevel()"]
  e617004e_5537_10df_c4ff_d3a07988283d -->|calls| 24c0fbca_1c0a_587d_aae0_6001704c3181
  dfad5438_2934_8c95_2cc5_2a619cfd3204["get()"]
  e617004e_5537_10df_c4ff_d3a07988283d -->|calls| dfad5438_2934_8c95_2cc5_2a619cfd3204
  501f40c7_eea3_8197_664f_2a7d4a9c3264["beforeInitialize()"]
  e617004e_5537_10df_c4ff_d3a07988283d -->|calls| 501f40c7_eea3_8197_664f_2a7d4a9c3264
  5442b6c9_c948_65c9_3b32_df1993add6a2["getName()"]
  e617004e_5537_10df_c4ff_d3a07988283d -->|calls| 5442b6c9_c948_65c9_3b32_df1993add6a2
  121b7287_c247_a3cc_c719_79c9c639fbd5["setLogLevel()"]
  e617004e_5537_10df_c4ff_d3a07988283d -->|calls| 121b7287_c247_a3cc_c719_79c9c639fbd5
  style e617004e_5537_10df_c4ff_d3a07988283d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java lines 388–406

	@Test
	void log4jLevelsArePropagatedToJul() {
		// In this test we need to use the global logging system, since JUL is a global
		// singleton.
		LoggingSystem loggingSystem = LoggingSystem.get(getClass().getClassLoader());
		loggingSystem.beforeInitialize();
		java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger("");
		// check if Log4jBridgeHandler is used
		Handler[] handlers = rootLogger.getHandlers();
		assertThat(handlers).hasSize(1);
		assertThat(handlers[0]).isInstanceOf(Log4jBridgeHandler.class);

		loggingSystem.initialize(this.initializationContext, null, null);
		java.util.logging.Logger logger = java.util.logging.Logger.getLogger(Log4J2LoggingSystemTests.class.getName());
		logger.info("Log to trigger level propagation");
		assertThat(logger.getLevel()).isNull();
		loggingSystem.setLogLevel(Log4J2LoggingSystemTests.class.getName(), LogLevel.DEBUG);
		assertThat(logger.getLevel()).isEqualTo(Level.FINE);
	}

Domain

Subdomains

Frequently Asked Questions

What does log4jLevelsArePropagatedToJul() do?
log4jLevelsArePropagatedToJul() is a function in the spring-boot codebase.
What does log4jLevelsArePropagatedToJul() call?
log4jLevelsArePropagatedToJul() calls 6 function(s): beforeInitialize, get, getLevel, getName, initialize, setLogLevel.

Analyze Your Own Codebase

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

Try Supermodel Free