diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 55af24f7f87..bc36053f83a 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -266,7 +266,7 @@ task runRemoteSpringApplicationExample(type: org.springframework.boot.build.docs task runSpringApplicationExample(type: org.springframework.boot.build.docs.ApplicationRunner) { classpath = configurations.springApplicationExample + sourceSets.main.output - mainClass = "org.springframework.boot.docs.features.springapplication.MyApplication" + mainClass = "org.springframework.boot.docs.features.logexample.MyApplication" args = ["--server.port=0"] output = file("$buildDir/example-output/spring-application.txt") expectedLogging = "Started MyApplication in " @@ -275,7 +275,7 @@ task runSpringApplicationExample(type: org.springframework.boot.build.docs.Appli task runLoggingFormatExample(type: org.springframework.boot.build.docs.ApplicationRunner) { classpath = configurations.springApplicationExample + sourceSets.main.output - mainClass = "org.springframework.boot.docs.features.springapplication.MyApplication" + mainClass = "org.springframework.boot.docs.features.logexample.MyApplication" args = ["--spring.main.banner-mode=off", "--server.port=0"] output = file("$buildDir/example-output/logging-format.txt") expectedLogging = "Started MyApplication in " diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/logexample/MyApplication.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/logexample/MyApplication.java new file mode 100644 index 00000000000..c588089d8d2 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/logexample/MyApplication.java @@ -0,0 +1,34 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.docs.features.logexample; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Sample application used to collect logs for the reference doc. + * + * @author Stephane Nicoll + */ +@SpringBootApplication +public class MyApplication { + + public static void main(String[] args) { + SpringApplication.run(MyApplication.class, args); + } + +}