public class ExceptionLogger {
Logger logger =
Logger.getLogger(ExceptionLogger.class);
public void exceptionLogger(Exception ex){
logger.error("异常种类:"+ex
+ " 时间:"+new Date());
StackTraceElement[] elements =
ex.getStackTrace();
logger.error(elements[0]);
}
}
有点小问题搞不大清楚Logger.getLogger(ExceptionLogger.class);
ExceptionLogger.class这个参数是干什么用的,这个logger到底能干什么,不用可以吗 |