日志的简单使用,两种方式: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");
|