@@ -87,6 +87,7 @@ public class JsonEncoder extends EncoderBase<ILoggingEvent> {
87
87
private static final String LINE_NUMBER_ATTR_NAME = "lineNumber" ;
88
88
89
89
public static final String STEP_ARRAY_NAME_ATTRIBUTE = "stepArray" ;
90
+ public static final String STACKTRACE_NAME_ATTRIBUTE = "stackTrace" ;
90
91
91
92
private static final char OPEN_OBJ = '{' ;
92
93
private static final char CLOSE_OBJ = '}' ;
@@ -122,7 +123,7 @@ public class JsonEncoder extends EncoderBase<ILoggingEvent> {
122
123
private boolean withMessage = true ;
123
124
private boolean withArguments = true ;
124
125
private boolean withThrowable = true ;
125
- private boolean withOriginalStackTrace = false ;
126
+ private boolean withPlainStackTrace = false ;
126
127
private boolean withFormattedMessage = false ;
127
128
128
129
@@ -268,8 +269,8 @@ private void appendThrowableProxy(StringBuilder sb, String attributeName, IThrow
268
269
}
269
270
270
271
sb .append (VALUE_SEPARATOR );
271
- if (withOriginalStackTrace ) {
272
- appenderMember (sb , "stackTrace" , getOriginalStackTrace (itp ));
272
+ if (withPlainStackTrace ) {
273
+ appenderMember (sb , STACKTRACE_NAME_ATTRIBUTE , getOriginalStackTrace (itp ));
273
274
} else {
274
275
appendSTEPArray (sb , itp .getStackTraceElementProxyArray (), itp .getCommonFrames ());
275
276
}
@@ -279,7 +280,7 @@ private void appendThrowableProxy(StringBuilder sb, String attributeName, IThrow
279
280
appenderMemberWithIntValue (sb , COMMON_FRAMES_COUNT_ATTR_NAME , itp .getCommonFrames ());
280
281
}
281
282
282
- if (!withOriginalStackTrace ) {
283
+ if (!withPlainStackTrace ) {
283
284
IThrowableProxy cause = itp .getCause ();
284
285
if (cause != null ) {
285
286
sb .append (VALUE_SEPARATOR );
@@ -323,7 +324,7 @@ private static void getOriginalStackTrace(IThrowableProxy throwable, StringBuild
323
324
}
324
325
sb .append (throwable .getClassName ()).append (": " ).append (throwable .getMessage ()).append (NEWLINE );
325
326
for (StackTraceElementProxy step : throwable .getStackTraceElementProxyArray ()) {
326
- sb .append (TAB ).append (step ).append (NEWLINE );
327
+ sb .append (TAB ).append (step . getSTEAsString () ).append (NEWLINE );
327
328
}
328
329
getOriginalStackTrace (throwable .getCause (), sb , depth + 1 );
329
330
}
@@ -543,11 +544,11 @@ public void setWithThrowable(boolean withThrowable) {
543
544
}
544
545
545
546
/**
546
- * @param withOriginalStackTrace
547
+ * @param withPlainStackTrace
547
548
* @since 1.5.7
548
549
*/
549
- public void setWithOriginalStackTrace (boolean withOriginalStackTrace ) {
550
- this .withOriginalStackTrace = withOriginalStackTrace ;
550
+ public void setWithPlainStackTrace (boolean withPlainStackTrace ) {
551
+ this .withPlainStackTrace = withPlainStackTrace ;
551
552
}
552
553
553
554
public void setWithFormattedMessage (boolean withFormattedMessage ) {
0 commit comments