Skip to content

Commit 2bf1753

Browse files
committed
Switch the default exception handler of PL to %ex
1 parent a4e72e0 commit 2bf1753

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public List<PatternFormatter> parse(
212212
list.add(new PatternFormatter(pc, field));
213213
}
214214
if (alwaysWriteExceptions && !handlesThrowable) {
215-
final LogEventPatternConverter pc = ExtendedThrowablePatternConverter.newInstance(config, new String[0]);
215+
final LogEventPatternConverter pc = ThrowablePatternConverter.newInstance(config, new String[0]);
216216
list.add(new PatternFormatter(pc, FormattingInfo.getDefault()));
217217
}
218218
return list;

src/changelog/.2.x.x/.release-notes.adoc.ftl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ See our xref:graalvm.adoc[GraalVM guide] for details.
3535

3636
Exception handling in xref:manual/pattern-layout.adoc[Pattern Layout] went through a major rewrite.
3737
This effectively helped with fixing some bugs by matching the feature parity of all exception converters.
38-
Additionally, rendered stack traces are ensured to be prefixed with a newline, which used to be a whitespace in earlier versions.
39-
The support for the `\{ansi}` option in exception converters is removed too.
38+
Some important highlights from this rewrite:
39+
40+
* Rendered stack traces are ensured to be prefixed with a newline, which used to be a whitespace in earlier versions.
41+
* Switched the default exception converter from xref:manual/pattern-layout.adoc#converter-exception-extended[the extended exception converter] to xref:manual/pattern-layout.adoc#converter-exception[the plain exception converter], which is more performant.
42+
* The support for the `\{ansi}` option in exception converters is removed.
4043

4144
[#release-notes-2-25-0-instant-format]
4245
=== Date & time formatting

src/changelog/.2.x.x/2691_change_PatternLayout_exception_rendering.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
55
type="changed">
66
<issue id="2691" link="https://github.com/apache/logging-log4j2/pull/2691"/>
7+
<issue id="3123" link="https://github.com/apache/logging-log4j2/pull/3123"/>
78
<description format="asciidoc">Consolidate exception rendering logic and improve circular reference support in Pattern Layout</description>
89
</entry>

src/changelog/.2.x.x/2691_deprecate_ThrowableProxy.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
55
type="deprecated">
66
<issue id="2691" link="https://github.com/apache/logging-log4j2/pull/2691"/>
7+
<issue id="3123" link="https://github.com/apache/logging-log4j2/pull/3123"/>
78
<description format="asciidoc">Deprecate `ThrowableProxy` and all its usages</description>
89
</entry>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="https://logging.apache.org/xml/ns"
4+
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
5+
type="changed">
6+
<issue id="3123" link="https://github.com/apache/logging-log4j2/pull/3123"/>
7+
<description format="asciidoc">Switch the default exception converter from xref:manual/pattern-layout.adoc#converter-exception-extended[the extended exception converter] to xref:manual/pattern-layout.adoc#converter-exception[the plain exception converter]</description>
8+
</entry>

0 commit comments

Comments
 (0)