@@ -87,6 +87,7 @@ public class JsonEncoder extends EncoderBase<ILoggingEvent> {
8787 private static final String LINE_NUMBER_ATTR_NAME = "lineNumber" ;
8888
8989 public static final String STEP_ARRAY_NAME_ATTRIBUTE = "stepArray" ;
90+ public static final String STACKTRACE_NAME_ATTRIBUTE = "stackTrace" ;
9091
9192 private static final char OPEN_OBJ = '{' ;
9293 private static final char CLOSE_OBJ = '}' ;
@@ -122,7 +123,7 @@ public class JsonEncoder extends EncoderBase<ILoggingEvent> {
122123 private boolean withMessage = true ;
123124 private boolean withArguments = true ;
124125 private boolean withThrowable = true ;
125- private boolean withOriginalStackTrace = false ;
126+ private boolean withPlainStackTrace = false ;
126127 private boolean withFormattedMessage = false ;
127128
128129
@@ -268,8 +269,8 @@ private void appendThrowableProxy(StringBuilder sb, String attributeName, IThrow
268269 }
269270
270271 sb .append (VALUE_SEPARATOR );
271- if (withOriginalStackTrace ) {
272- appenderMember (sb , "stackTrace" , getOriginalStackTrace (itp ));
272+ if (withPlainStackTrace ) {
273+ appenderMember (sb , STACKTRACE_NAME_ATTRIBUTE , getOriginalStackTrace (itp ));
273274 } else {
274275 appendSTEPArray (sb , itp .getStackTraceElementProxyArray (), itp .getCommonFrames ());
275276 }
@@ -279,7 +280,7 @@ private void appendThrowableProxy(StringBuilder sb, String attributeName, IThrow
279280 appenderMemberWithIntValue (sb , COMMON_FRAMES_COUNT_ATTR_NAME , itp .getCommonFrames ());
280281 }
281282
282- if (!withOriginalStackTrace ) {
283+ if (!withPlainStackTrace ) {
283284 IThrowableProxy cause = itp .getCause ();
284285 if (cause != null ) {
285286 sb .append (VALUE_SEPARATOR );
@@ -323,7 +324,7 @@ private static void getOriginalStackTrace(IThrowableProxy throwable, StringBuild
323324 }
324325 sb .append (throwable .getClassName ()).append (": " ).append (throwable .getMessage ()).append (NEWLINE );
325326 for (StackTraceElementProxy step : throwable .getStackTraceElementProxyArray ()) {
326- sb .append (TAB ).append (step ).append (NEWLINE );
327+ sb .append (TAB ).append (step . getSTEAsString () ).append (NEWLINE );
327328 }
328329 getOriginalStackTrace (throwable .getCause (), sb , depth + 1 );
329330 }
@@ -543,11 +544,11 @@ public void setWithThrowable(boolean withThrowable) {
543544 }
544545
545546 /**
546- * @param withOriginalStackTrace
547+ * @param withPlainStackTrace
547548 * @since 1.5.7
548549 */
549- public void setWithOriginalStackTrace (boolean withOriginalStackTrace ) {
550- this .withOriginalStackTrace = withOriginalStackTrace ;
550+ public void setWithPlainStackTrace (boolean withPlainStackTrace ) {
551+ this .withPlainStackTrace = withPlainStackTrace ;
551552 }
552553
553554 public void setWithFormattedMessage (boolean withFormattedMessage ) {
0 commit comments