HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🧚
[1기]최종 프로젝트 데브코스
/
📜
[팀13] 사각사각 ✏️
/
🎊
기술 문서
/
✏️
Logback 설정
✏️

Logback 설정

logback.xml

<?xml version="1.0" encoding="UTF-8"?> <configuration> <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="%clr(%d{HH:mm:ss}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%-4t]){faint} %clr(%-40.40logger{35}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="console"/> </root> </configuration>
%d : 로그 기록시간 (시.분.초)만 나오게 설정.
%-4t : 로깅 발생 Thread명  (출력 고정폭 조정
(+) 로그만 설정하여 디벨롭에 바로 Push참고자료
 
참고자료
[스프링부트 (5)] Spring Boot 로그 설정(1) - Logback
안녕하세요. 갓대희 입니다. 이번 포스팅은 [ 스프링 부트 Log 설정 - 로그백 ] 입니다. : -) - 자바 - - log4j,오픈소스 로깅 프레임워크 , SLF4J의 구현체 스프링 부트의 기본으로 설정 되어 있어서 사용시 별도로 라이브러리를 추가하지 않아도 된다. log4j2 등과 성능을 비교했을 때에도 logback이 더 훌륭한 성능 을 보여준다.
[스프링부트 (5)] Spring Boot 로그 설정(1) - Logback
https://goddaehee.tistory.com/206
[스프링부트 (5)] Spring Boot 로그 설정(1) - Logback
Spring Boot - Customizing Console Logging Format
In this example, we will see how to customize console pattern by specifying logging.pattern.console property in application.properties file. The easy way to do that to copy paste the default pattern as specified in DefaultLogbackConfiguration class as CONSOLE_LOG_PATTERN constant and start modifying it.
Spring Boot - Customizing Console Logging Format
https://www.logicbig.com/tutorials/spring-framework/spring-boot/logging-console-pattern.html
Spring Boot - Customizing Console Logging Format