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

withFile() — spring-boot Function Reference

Architecture documentation for the withFile() function in LogbackLoggingSystemTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  34d2c822_c47d_87af_b91c_1cd508fd160c["withFile()"]
  58d8d837_b5a1_09c5_cdb4_ff02e18c8c38["initialize()"]
  34d2c822_c47d_87af_b91c_1cd508fd160c -->|calls| 58d8d837_b5a1_09c5_cdb4_ff02e18c8c38
  bc937c1c_ec1c_7511_0eee_c35de09ea03e["getLogFile()"]
  34d2c822_c47d_87af_b91c_1cd508fd160c -->|calls| bc937c1c_ec1c_7511_0eee_c35de09ea03e
  13cca41d_e6d4_6c55_4166_597017d5c02e["tmpDir()"]
  34d2c822_c47d_87af_b91c_1cd508fd160c -->|calls| 13cca41d_e6d4_6c55_4166_597017d5c02e
  599de821_15df_43cf_ef7e_1637f660f37b["getLineWithText()"]
  34d2c822_c47d_87af_b91c_1cd508fd160c -->|calls| 599de821_15df_43cf_ef7e_1637f660f37b
  2c1789c5_7083_293b_2c92_43021688613d["getRollingPolicy()"]
  34d2c822_c47d_87af_b91c_1cd508fd160c -->|calls| 2c1789c5_7083_293b_2c92_43021688613d
  501f40c7_eea3_8197_664f_2a7d4a9c3264["beforeInitialize()"]
  34d2c822_c47d_87af_b91c_1cd508fd160c -->|calls| 501f40c7_eea3_8197_664f_2a7d4a9c3264
  style 34d2c822_c47d_87af_b91c_1cd508fd160c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java lines 193–207

	@Test
	void withFile(CapturedOutput output) {
		this.loggingSystem.beforeInitialize();
		this.logger.info("Hidden");
		initialize(this.initializationContext, null, getLogFile(null, tmpDir()));
		this.logger.info("Hello world");
		File file = new File(tmpDir() + "/spring.log");
		assertThat(output).doesNotContain("LOGBACK:");
		assertThat(output).contains("Hello world").doesNotContain("Hidden");
		assertThat(getLineWithText(output, "Hello world")).contains("INFO");
		assertThat(file).exists();
		assertThat(getLineWithText(file, "Hello world")).contains("INFO");
		assertThat(ReflectionTestUtils.getField(getRollingPolicy(), "maxFileSize")).hasToString("10 MB");
		assertThat(getRollingPolicy().getMaxHistory()).isEqualTo(7);
	}

Domain

Subdomains

Frequently Asked Questions

What does withFile() do?
withFile() is a function in the spring-boot codebase.
What does withFile() call?
withFile() calls 6 function(s): beforeInitialize, getLineWithText, getLogFile, getRollingPolicy, initialize, tmpDir.

Analyze Your Own Codebase

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

Try Supermodel Free