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