This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch feature/2.x/StatusData-newline-prefix in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit a68c5e12e7244670b481860d619a688588df70a5 Author: Volkan Yazıcı <[email protected]> AuthorDate: Thu Oct 31 14:21:20 2024 +0100 Prefix stack traces with a newline in Status Logger --- .../src/main/java/org/apache/logging/log4j/status/StatusData.java | 2 +- .../log4j/core/appender/rolling/action/AbstractActionTest.java | 5 +++-- src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml | 2 +- ...ge_PatternLayout_prefix.xml => 3149_change_StatusData_prefix.xml} | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java index 337224459a..b100ade3ed 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java @@ -182,7 +182,7 @@ public class StatusData implements Serializable { effectiveThrowable = throwable; } if (effectiveThrowable != null) { - sb.append(SPACE); + sb.append(System.lineSeparator()); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); effectiveThrowable.printStackTrace(new PrintStream(baos)); /* diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractActionTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractActionTest.java index f9f3752185..1e04d8491a 100644 --- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractActionTest.java +++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractActionTest.java @@ -47,8 +47,9 @@ class AbstractActionTest { assertThat( formattedMessage, containsString("Exception reported by action 'class org.apache." - + "logging.log4j.core.appender.rolling.action.AbstractActionTest$TestAction' java.io.IOException: " - + "failed" + System.lineSeparator() + + "logging.log4j.core.appender.rolling.action.AbstractActionTest$TestAction'" + + System.lineSeparator() + + "java.io.IOException: failed" + System.lineSeparator() + "\tat org.apache.logging.log4j.core.appender.rolling.action.AbstractActionTest" + "$TestAction.execute(AbstractActionTest.java:")); } diff --git a/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml b/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml index 048c101299..6c7cd945ec 100644 --- a/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml +++ b/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml @@ -4,5 +4,5 @@ xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" type="changed"> <issue id="3045" link="https://github.com/apache/logging-log4j2/pull/3045"/> - <description format="asciidoc">Change the whitespace prefixing logic in Pattern Layout</description> + <description format="asciidoc">Switch prefixing stack traces in Pattern Layout from whitespace to newline</description> </entry> diff --git a/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml b/src/changelog/.2.x.x/3149_change_StatusData_prefix.xml similarity index 59% copy from src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml copy to src/changelog/.2.x.x/3149_change_StatusData_prefix.xml index 048c101299..2c269f6624 100644 --- a/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml +++ b/src/changelog/.2.x.x/3149_change_StatusData_prefix.xml @@ -3,6 +3,6 @@ xmlns="https://logging.apache.org/xml/ns" xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" type="changed"> - <issue id="3045" link="https://github.com/apache/logging-log4j2/pull/3045"/> - <description format="asciidoc">Change the whitespace prefixing logic in Pattern Layout</description> + <issue id="3149" link="https://github.com/apache/logging-log4j2/pull/3149"/> + <description format="asciidoc">Switch prefixing stack traces in Status Logger from whitespace to newline</description> </entry>
