pjj
pjj

Reputation: 2135

How to check logging implementation details in Spring Boot

I am using Spring boot.

I want to check which logging implementation is printing the message - I know with Spring boot default is Logback, and I have excluded it as mentioned in this post so mostly Logback will not be printing the messages, but I want to show it as a proof that Logback implementation is not printing and probably Log4j is printing.

Basically I need an API which I can call and I can get the details of which is the logging implementation, the way we can know Java version etc.

Upvotes: 2

Views: 1734

Answers (2)

Sreehari Puliyakkot
Sreehari Puliyakkot

Reputation: 736

To check configuration you can install spring actuator framework. Through web endpoints all config params can be queried.

Upvotes: 1

Maciej Kowalski
Maciej Kowalski

Reputation: 26522

You can enforce Spring Boot to use a certain implementation by setting this property:

org.springframework.boot.logging.LoggingSystem

with any of:

  • org.springframework.boot.logging.logback.LogbackLoggingSystem
  • org.springframework.boot.logging.log4j2.Log4J2LoggingSystem
  • org.springframework.boot.logging.java.JavaLoggingSystem
  • none (to swith off completely)

This explicit configuration would be your proof.

Upvotes: 3

Related Questions