环境
SpringBoot1.5.20
前言
SpringBoot
项目中,spring-boot-starter
已经包含了spring-boot-starter-logging
,不需要再引入依赖
代码配置
LogConfig.java
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;