|
@@ -26,7 +26,7 @@ public class RedisLogService implements IRedisLogService {
|
|
|
public String getLogInfo(String taskId) {
|
|
|
List<String> logs = redisCache.getCacheList(taskId);
|
|
|
String logStr = logs.get(0);
|
|
|
- log.error(logStr);
|
|
|
+ log.info("GET::{}", logStr);
|
|
|
logs.remove(0);
|
|
|
return logStr;
|
|
|
}
|
|
@@ -44,15 +44,11 @@ public class RedisLogService implements IRedisLogService {
|
|
|
private void addInfo(String level, String taskId, String megStr) {
|
|
|
List<String> logs = new ArrayList<>();
|
|
|
try {
|
|
|
- Thread.sleep(1000);// 单位:毫秒
|
|
|
String message = String.format("<p style='color: #58e072'> %s: [%s] -> %s </p>", level, DateUtil.now(), megStr);
|
|
|
if ("ERROR".equals(level)) {
|
|
|
message = String.format("<p style='color: #e3270e'> %s: [%s] %s </p>", level, DateUtil.now(), megStr);
|
|
|
}
|
|
|
log.info(megStr);
|
|
|
- if (redisCache.hasKey(taskId)) {
|
|
|
- message = redisCache.getCacheObject(taskId) + message;
|
|
|
- }
|
|
|
logs.add(message);
|
|
|
redisCache.setCacheList(taskId, logs);
|
|
|
} catch (Exception e) {
|