|
|
@ -20,7 +20,7 @@ import org.apache.log4j.spi.LoggingEvent; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 收集设计器报错信息的appender. |
|
|
|
* 收集设计器报错信息的appender. |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* Created by Administrator on 2017/7/24 0024. |
|
|
|
* Created by Administrator on 2017/7/24 0024. |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -28,7 +28,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { |
|
|
|
|
|
|
|
|
|
|
|
private static final int ERROR_LEN = 8; |
|
|
|
private static final int ERROR_LEN = 8; |
|
|
|
|
|
|
|
|
|
|
|
// 缓存下不变的, 没必要频繁取.
|
|
|
|
// 缓存下不变的, 没必要频繁取.
|
|
|
|
private String username; |
|
|
|
private String username; |
|
|
|
private String uuid; |
|
|
|
private String uuid; |
|
|
|
private String activekey; |
|
|
|
private String activekey; |
|
|
@ -60,10 +60,10 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { |
|
|
|
|
|
|
|
|
|
|
|
public void subAppend(LoggingEvent event) { |
|
|
|
public void subAppend(LoggingEvent event) { |
|
|
|
Level level = event.getLevel(); |
|
|
|
Level level = event.getLevel(); |
|
|
|
// 只分析上传记录error以上的.
|
|
|
|
// 只分析上传记录error以上的.
|
|
|
|
if (level.isGreaterOrEqual(FRLogLevel.ERROR)) { |
|
|
|
if (level.isGreaterOrEqual(FRLogLevel.ERROR)) { |
|
|
|
String msg = this.layout.format(event); |
|
|
|
String msg = this.layout.format(event); |
|
|
|
// 这个id并不是一定会有的, 有就记录下, 说明是预览模板出的错.
|
|
|
|
// 这个id并不是一定会有的, 有就记录下, 说明是预览模板出的错.
|
|
|
|
String templateid = readTemplateID(); |
|
|
|
String templateid = readTemplateID(); |
|
|
|
String logid = readLogID(msg); |
|
|
|
String logid = readLogID(msg); |
|
|
|
ErrorInfo errorInfo = new ErrorInfo(username, uuid, activekey); |
|
|
|
ErrorInfo errorInfo = new ErrorInfo(username, uuid, activekey); |
|
|
@ -103,7 +103,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String bookPath = infor.getBookPath(); |
|
|
|
String bookPath = infor.getBookPath(); |
|
|
|
// 这个iofile只读一个templateid, 其他以后有需要再读.
|
|
|
|
// 这个iofile只读一个templateid, 其他以后有需要再读.
|
|
|
|
IOFile file = new IOFile() { |
|
|
|
IOFile file = new IOFile() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void readStream(InputStream in) throws Exception { |
|
|
|
public void readStream(InputStream in) throws Exception { |
|
|
|