POM :
org.slf4j slf4j-api 1.7.1 org.slf4j jcl-over-slf4j 1.7.1 org.slf4j log4j-over-slf4j 1.6.6 org.slf4j jul-to-slf4j 1.7.1 ch.qos.logback logback-core 1.1.2 ch.qos.logback logback-classic 1.1.2
Class : Log
package com.xindatai.ibs.environ.util.constant;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class Log { public static final Logger LOGGER = LoggerFactory.getLogger("ibs.log"); public static final Logger DEVICE_LOGGER = LoggerFactory.getLogger("device.log");}
logback.xml
[%-5level %d{yyyy-MM-dd HH:mm:ss} %c{0}] - %m%n ${catalina.base}/logs/ibs.log ${catalina.base}/logs/ibs.%d.gz [%-5level %d{yyyy-MM-dd HH:mm:ss} %c{0}] - %m%n ${catalina.base}/logs/device.log ${catalina.base}/logs/device.%d.gz [%-5level %d{yyyy-MM-dd HH:mm:ss} %c{0}] - %m%n
Class :
Log.LOGGER.warn("从picker获取环境检测及控制设备的信息:" + new Date() + "--开始搜集");Log.DEVICE_LOGGER.warn("执行营业时间空调及净化器策略--Start");
File :
啦啦啦
啦啦啦