Java 日志工具使用

日志的简单使用,两种方式:org.apache.commons.logging.Log日志包,org.apache.log4j.Logger日志包。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
private static final Log log = LogFactory.getLog(this.getClass());

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static Logger logger = LoggerFactory.getLogger(xxxClass.class);

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
private static final Logger logger = LogManager.getLogger(xxxClass.class);

import java.util.logging.Logger;
Logger logger = Logger.getLogger("serviceLogger");
作者

光星

发布于

2018-01-21

更新于

2022-06-17

许可协议

评论