logback-spring.xml을 추가한다!
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr([${LOG_LEVEL_PATTERN:-%5p}]) : %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m %n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-default}" />
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>${CONSOLE_LOG_CHARSET}</charset>
</encoder>
</appender>
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
<!-- SQL 보여주기 -->
<logger name="jdbc.sqlonly" level="INFO" appender-ref="console-infolog" />
<!-- 조회 결과를 테이블로 보여주기 -->
<logger name="jdbc.resultsettable" level="INFO" appender-ref="console-infolog" />
<logger name="org.springframework" level="error" />
<logger name="org.springframework.jdbc" level="error" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
'Web & Android > SpringBoot' 카테고리의 다른 글
[SpringBoot] Spring Boot Devtools (0) | 2023.10.14 |
---|---|
[SpringBoot] 파일 경로 설명 (0) | 2023.10.14 |
[SpringBoot] Validation (0) | 2023.10.13 |
[SpringBoot] HTTP form에서 put, delete 사용법 (0) | 2023.10.13 |
[SpringBoot] REST API (0) | 2023.10.13 |