Issue
I can access the controller in web browser, but I can't see its mapping message in the console log. Normally when spring boot app starts, the eclipse console should print out the mapped controller and the accessing url, why didn't I see it?
I have already added the logging.level.org.springframework.web=DEBUG
to application.properties file, but it does not help.
Updated:
This is my pom.xml
file:
<modelVersion>4.0.0</modelVersion>
<groupId>com.yp</groupId>
<artifactId>BootTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BootTest</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
The snippet of console log when app starts
Is there any way to show up mapped controller info when app starts?
Solution
please view Spring Boot 2.1 Release Notes#logging-refinements
Spring Framework 5.1 revisited the debug logging output while working on web applications (Spring MVC or Spring WebFlux). If you are trying to debug an application and you want to restore Spring Boot 2.0 style logging you should add the following to your application.properties:
logging.level.web=debug
You might also want to set
spring.http.log-request-details
to true to log actual request details. By default this property is false as it can potentially expose sensitive information.
Answered By - Bin Zhan
Answer Checked By - Mildred Charles (JavaFixing Admin)