logback-spring.xml
2.使用示例
Java
运行代码
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cn.test.web.controller.im;
import com.zhicall.framework.core.common.utils.log.LogProxy;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import java.util.concurrent.TimeUnit;
/**
- @author Herb
@create 2020-04-26 13:05
**/
@RestController
@RequestMapping("/test")
public class TestController {private Logger logger = LogProxy.getLogger("INFO_LOG");
private Logger logger2 = LogProxy.getLogger("ERROR_LOG");
@Autowired
private ImPlatformDoctorService imPlatformDoctorService;@Autowired
protected RedisTemplate redisTemplate;@GetMapping("/getuser")
public void getuser() {logger.info("进入getUser(INFO_LOG-INFO)"); logger.error("进入getUser(INFO_LOG-ERROR)"); logger2.error("进入getUser(ERROR_LOG-ERROR)"); imPlatformDoctorService.queryDoctorConfig(10407L, "1");}
}