Browse Source

优化取堆栈记录逻辑

research/10.0
1 6 years ago
parent
commit
5e9f60c5d7
  1. 6
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

6
designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -82,14 +82,12 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
private String readStackTrace(LoggingEvent event) { private String readStackTrace(LoggingEvent event) {
String[] s = event.getThrowableStrRep(); String[] s = event.getThrowableStrRep();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if(s != null){ if (s != null) {
int len = s.length; int len = Math.min(s.length, ERROR_STACK_TRACE);
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
if(i < ERROR_STACK_TRACE){
sb.append(s[i]).append("\n"); sb.append(s[i]).append("\n");
} }
} }
}
return sb.toString(); return sb.toString();
} }

Loading…
Cancel
Save