6

I've been trying to figure out what I'm missing with my RestTemplate setup (particularly OAuth2RestTemplate) so I want to see the logs for debugging. I found one possible solution for it, but nothing about the operation of the RestTemplate gets shown.

What I've done so far is to replace the default Logback logging mechanism in my Spring Boot app by following the configuration shown here. When I run my Spring Boot application after changing the logging dependencies, all I see on the console is the Spring logo (in ASCII) and nothing else. I've already defined a log4j-spring.properties in src/main/resources with the property defined in the previous link.

What else am I missing here? Do I need to run my Spring Boot app in debug mode? If so, how do I do that? Also, how do I set this up using the default Logback mechanism?

Community
  • 1
  • 1
Psycho Punch
  • 6,418
  • 9
  • 53
  • 86
  • 5
    Why would you need log4j for that? Just add `logging.level.org.springframework.web.client=DEBUG` to your `application.properties`. Don't make it more complicated then that, just use logback (at least don't use log4j as that is deprecated). – M. Deinum Apr 29 '16 at 12:14
  • Hence the question. The best reference I can find is the StackOverflow answer I linked to, which describes how to do it in log4j. Now, I'm asking how to do the same thing in Logback. – Psycho Punch Apr 29 '16 at 12:18
  • I've updated the question to make it a bit clearer. – Psycho Punch Apr 29 '16 at 12:21
  • See the comment... You can do it regardless WHICH logging framework by simply adding it to the `application.properties`. Also instead of asking a question on how to enable logging you might want to ask a question what is wrong with your setup for the `RestTemplate`... – M. Deinum Apr 29 '16 at 12:23
  • https://stackoverflow.com/questions/7952154/spring-resttemplate-how-to-enable-full-debugging-logging-of-requests-responses/47467572 – user2746033 Nov 24 '17 at 06:41

0 Answers0