import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; private Log logger = LogFactory.getLog(this.getClass()); //将信息输入到log public void logPrint(String Info) { System.out.println(Info); logger.info(Info); } private void printLog(){ User user = (User) WebUtils.getSessionData (Constant.USER_KEY); //-------------------打入到日志中的访员操作信息------start---------------- String user_name = user.getUser_name(); SimpleDateFormat sDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String Info = "项目信息导出_用户姓名:"+user_name+"----开始时间:"+sDF.format(new Date()); this.logPrint(Info); //-------------------打入到日志中的访员操作信息------end---------------- return null; }