private static final Logger logger = LoggerFactory.getLogger(TestLog.class);
private StringBuffer logMessage;
public String return logMessage(){
appendLog("同步【 %s 】操作数据信息: %s ",type, user.toString());
appendLog("----------数据事务提交--结束--【共耗时: %s ms】-------------", System.currentTimeMillis() -commitStartTime);
return logMessage.toString();
}
/***
* description:记录日志
* @param message
* @param args
* @return void
*/
private void appendLog(String message,Object... args){
String log = String.format(message, args);
logMessage.append(log + "\n");
logger.info(log);
}