I use the following log level logging.level.org.springframework.web= ERROR and wish also to see in my log 404 error (with full URL) that is generated when requested URL cannot be matched to any controller. What is the best way for this?
Asked
Active
Viewed 1,654 times
4
Bizon4ik
- 2,444
- 4
- 19
- 42
-
Include more information, code snippets, screenshots, log trace. which could be helpful in finding a solution. – Vikram Palakurthi Mar 29 '18 at 21:51
-
@VikramPalakurthi I created a new spring-boot app without any controller. Put above mention logging level in `application.property` and start the app. Then send some request to this app and obtained 404 error in response, however, there is nothing in the application log. What should I do to find 404 error in log (change log level to `DEBUG` is not an option)? – Bizon4ik Mar 29 '18 at 22:13
-
So when there is no controller in place and you are trying to access the url which gave you a 404 error. This sounds right to me. Implement a base controller and then try to access it. What you created is just a simple application without any access points, try to complete it by adding a controller and methods which handle requests and send responses (view or json) for example. – Vikram Palakurthi Mar 29 '18 at 22:19
-
And, if you want to see the logs you need to update the log config for tomcat, if that's what you are using. – Vikram Palakurthi Mar 29 '18 at 22:20
-
use this reference to enable logs https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html – Vikram Palakurthi Mar 29 '18 at 22:21
-
Possible duplicate of [Spring Boot: How can I set the logging level with application.properties?](https://stackoverflow.com/questions/20485059/spring-boot-how-can-i-set-the-logging-level-with-application-properties) – Vikram Palakurthi Mar 29 '18 at 22:24