What is debug logging in spring MVC

My spring MVC is not working, and I get a resource error not found.

I heard about debug logging.

This is something that I can turn on, and I can see more details about where the problem is, or

this is what I need to program in each file, only this message will be shown, which I am hard-coded in the file

+4
source share
3 answers

Spring uses the Apache Commons logging API, which in turn uses either Java internal logging or log4j (if available). See this part of the docs for a more complete explanation.

The “debug log” refers to the fact that Spring performs a lot of detailed logging at the “debug” level, which is usually not written. However, you can reconfigure the registration to show this level of information, if necessary. Again, see the link above.

+5
source

In your log4j.properties file, set the logging level for Spring to DEBUG, something like lines

log4j.logger.org.springframework = DEBUG, <Some appender> 
0
source

From a personal blog post, the required maven dependencies are:

 <properties> ... <spring.version>3.1.2.RELEASE</spring.version> <slf4j.version>1.7.1</slf4j.version> <logback.version>0.9.30</logback.version> </properties> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> <type>jar</type> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${slf4j.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> <type>jar</type> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${logback.version}</version> </dependency> 

The above method allows you to login. Check the appropriate documentation to set your desired logging level.

0
source

Source: https://habr.com/ru/post/1341513/


All Articles