To print logs in JSON format with SLF4J in Spring Boot, you can use Logback as the logging framework. You can add the following dependencies to your pom.xml file:
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.6</version>
</dependency>