1. build.gradle (또는 pom.xml)에 logback 라이브러리 추가
compile("ch.qos.logback:logback-classic:1.1.2")
compile("ch.qos.logback:logback-core:1.1.2")
compile("org.slf4j:slf4j-api:1.7.6")
2. logback-spring.xml 정의
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<logger name="org.springframework.web" level="info"/>
<logger name="com.kakao.story.gateway" level="debug" />
<springProfile name="production">
<logger name="com.kakao.story.gateway" level="info" />
</springProfile>
3. application.yml 에 logging.config 추가
가장 중요함.
logging:
config: classpath:logback.xml
'general java' 카테고리의 다른 글
| [spring] p와 c 노테이션으로 spring rest template을 간결하게 사용하기 (0) | 2015.10.05 |
|---|---|
| [spring] LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods 해결하기 (0) | 2015.10.01 |
| [spring boot] 기본 log 쓰지 않고, logback 사용할 수 있도록 추가하기 (0) | 2015.09.30 |
| [spring boot] Cannot find template location 에러 해결 (0) | 2015.09.30 |
| [spring boot] logback에 springProfile 설정하기 - no applicable action for [springProfile] (0) | 2015.09.30 |
| [spring boot] spring-loaded 대신 devtools (0) | 2015.09.30 |



댓글을 달아 주세요