This is the works of Spring Boot
that is dealing underneath with logging routing jul
, jcl
and log4j
over slf4j
and employing Logback
via slf4j
as you can tell by the distinguishable shortened namespace class names.
All this is nicely visible via the IntelliJ diagram tool directly on the pom file:
This setup is following the best practise as described/depicted in the SLF4J site:
The log is chatty because of the Spring DEBUG
level. To alter that:
1) Create a resources
directory under <projectDir>/src/main
as you would have in a Maven project.
2) Create a logback.xml
file in it containing:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>web - %date [%thread] %-5level %logger{36} - %message%n
</pattern>
</encoder>
</appender>
<logger name="org.springframework" level="WARN" />
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
and voila!
Creating tables
Inserting customer record for John Woo
Inserting customer record for Jeff Dean
Inserting customer record for Josh Bloch
Inserting customer record for Josh Long
Querying for customer records where first_name = 'Josh':
Customer[id=3, firstName='Josh', lastName='Bloch']
Customer[id=4, firstName='Josh', lastName='Long']