You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2026/08/27 10:08:33 UTC
(logging-log4j2) branch pluginMessage created (now f3fea1d64c)
This is an automated email from the ASF dual-hosted git repository.
vy pushed a change to branch pluginMessage
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
at f3fea1d64c Add changelog
This branch includes the following new commits:
new 378ec13637 Switch the default minimum allowed plugin processor message severity from NOTE to ERROR
new f3fea1d64c Add changelog
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(logging-log4j2) 01/02: Switch the default minimum allowed plugin processor message severity from NOTE to ERROR
Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch pluginMessage
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 378ec136373d71995c88a1d389ca94e5128a04fe
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Thu Aug 27 11:57:55 2026 +0200
Switch the default minimum allowed plugin processor message severity from NOTE to ERROR
---
.../plugins/processor/GraalVmProcessorTest.java | 23 +++++++++++++++-------
.../processor/PluginProcessorPublicSetterTest.java | 13 +++++-------
.../config/plugins/processor/GraalVmProcessor.java | 4 ++--
.../config/plugins/processor/PluginProcessor.java | 6 +++---
4 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessorTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessorTest.java
index f46150f4a3..650b6f3f70 100644
--- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessorTest.java
+++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessorTest.java
@@ -216,9 +216,14 @@ class GraalVmProcessorTest {
}
@Test
- void whenNoGroupIdAndArtifactId_thenWarningIsPrinted(@TempDir(cleanup = CleanupMode.NEVER) Path outputDir)
+ void whenNoGroupIdAndArtifactId_thenWarningIsEmittedWhenConfigured(@TempDir(cleanup = CleanupMode.NEVER) Path outputDir)
throws Exception {
- List<String> diagnostics = generateDescriptor(sourceDir, null, null, outputDir);
+ List<String> diagnostics = generateDescriptor(
+ sourceDir,
+ null,
+ null,
+ outputDir,
+ "-A" + PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION + "=WARNING");
assertThat(diagnostics).hasSize(1);
// The warning message should contain the information about the missing groupId and artifactId arguments
assertThat(diagnostics.get(0))
@@ -241,9 +246,14 @@ class GraalVmProcessorTest {
}
@Test
- void noteEmittedByDefaultWithLog4jPrefix(@TempDir Path outputDir) throws Exception {
+ void noteEmittedWhenConfiguredWithLog4jPrefix(@TempDir Path outputDir) throws Exception {
List<Diagnostic<? extends JavaFileObject>> diagnostics =
- generateDiagnostics(sourceDir, GROUP_ID, ARTIFACT_ID, outputDir);
+ generateDiagnostics(
+ sourceDir,
+ GROUP_ID,
+ ARTIFACT_ID,
+ outputDir,
+ "-A" + PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION + "=NOTE");
assertThat(diagnostics)
.anyMatch(diagnostic -> diagnostic.getKind() == Diagnostic.Kind.NOTE
@@ -253,13 +263,12 @@ class GraalVmProcessorTest {
}
@Test
- void notesSuppressedWithoutAffectingMetadataGeneration(@TempDir Path outputDir) throws Exception {
+ void notesSuppressedByDefaultWithoutAffectingMetadataGeneration(@TempDir Path outputDir) throws Exception {
List<Diagnostic<? extends JavaFileObject>> diagnostics = generateDiagnostics(
sourceDir,
GROUP_ID,
ARTIFACT_ID,
- outputDir,
- "-A" + PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION + "=warning");
+ outputDir);
assertThat(diagnostics)
.noneMatch(diagnostic -> diagnostic.getKind() == Diagnostic.Kind.NOTE
diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessorPublicSetterTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessorPublicSetterTest.java
index 3772cced4d..0d44f12e9c 100644
--- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessorPublicSetterTest.java
+++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessorPublicSetterTest.java
@@ -113,7 +113,8 @@ public class PluginProcessorPublicSetterTest {
}
@Test
- void noteEmittedByDefault() {
+ void noteEmittedWhenConfigured() {
+ setupWithOptions("-A" + PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION + "=NOTE");
final List<Diagnostic<? extends JavaFileObject>> noteDiagnostics = diagnosticCollector.getDiagnostics().stream()
.filter(d -> d.getKind() == Diagnostic.Kind.NOTE)
.collect(Collectors.toList());
@@ -141,7 +142,7 @@ public class PluginProcessorPublicSetterTest {
@ParameterizedTest
@ValueSource(strings = {"NOTE", "note"})
- void explicitNoteKindBehavesLikeDefault(final String kindValue) {
+ void explicitNoteKindEmitsNotes(final String kindValue) {
setupWithOptions("-A" + PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION + "=" + kindValue);
assertThat(errorDiagnostics).anyMatch(d -> d.getMessage(Locale.ROOT)
@@ -154,17 +155,13 @@ public class PluginProcessorPublicSetterTest {
}
@Test
- void invalidKindValueEmitsWarning() {
+ void invalidKindValueDoesNotEmitWarningByDefault() {
setupWithOptions("-A" + PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION + "=INVALID");
final List<Diagnostic<? extends JavaFileObject>> warningDiagnostics =
diagnosticCollector.getDiagnostics().stream()
.filter(d -> d.getKind() == Diagnostic.Kind.WARNING)
.collect(Collectors.toList());
- assertThat(warningDiagnostics)
- .anyMatch(d -> d.getMessage(Locale.ROOT)
- .startsWith(
- "[Log4j] org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor:")
- && d.getMessage(Locale.ROOT).contains("unrecognized value `INVALID`"));
+ assertThat(warningDiagnostics).isEmpty();
}
}
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessor.java
index 05528f96a9..b35344054b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessor.java
@@ -84,7 +84,7 @@ public class GraalVmProcessor extends AbstractProcessor {
private final Map<String, ReachabilityMetadata.Type> reachableTypes = new HashMap<>();
private final List<Element> processedElements = new ArrayList<>();
private Annotations annotationUtil;
- private Diagnostic.Kind minAllowedMessageKind = Diagnostic.Kind.NOTE;
+ private Diagnostic.Kind minAllowedMessageKind = Diagnostic.Kind.ERROR;
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
@@ -102,7 +102,7 @@ public class GraalVmProcessor extends AbstractProcessor {
GraalVmProcessor.class.getName(),
kindValue,
PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION,
- Diagnostic.Kind.NOTE,
+ Diagnostic.Kind.ERROR,
Arrays.toString(Diagnostic.Kind.values())));
}
}
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
index 51b7e09109..4896d30dbb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
@@ -83,7 +83,7 @@ public class PluginProcessor extends AbstractProcessor {
* </p>
* <p>
* Accepted values (case-insensitive): {@code NOTE}, {@code WARNING}, {@code MANDATORY_WARNING},
- * {@code ERROR}, {@code OTHER}. Defaults to {@code NOTE}.
+ * {@code ERROR}, {@code OTHER}. Defaults to {@code ERROR}.
* </p>
*/
static final String MIN_ALLOWED_MESSAGE_KIND_OPTION = "log4j.plugin.processor.minAllowedMessageKind";
@@ -97,7 +97,7 @@ public class PluginProcessor extends AbstractProcessor {
private final List<Element> processedElements = new ArrayList<>();
private final PluginCache pluginCache = new PluginCache();
- private Diagnostic.Kind minAllowedMessageKind = Diagnostic.Kind.NOTE;
+ private Diagnostic.Kind minAllowedMessageKind = Diagnostic.Kind.ERROR;
@Override
public void init(final ProcessingEnvironment processingEnv) {
@@ -114,7 +114,7 @@ public class PluginProcessor extends AbstractProcessor {
PluginProcessor.class.getName(),
kindValue,
MIN_ALLOWED_MESSAGE_KIND_OPTION,
- Diagnostic.Kind.NOTE,
+ Diagnostic.Kind.ERROR,
Arrays.toString(Diagnostic.Kind.values())));
}
}
(logging-log4j2) 02/02: Add changelog
Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch pluginMessage
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit f3fea1d64c695ae9a3692b0824bf192be8e239e3
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Thu Aug 27 11:59:54 2026 +0200
Add changelog
---
...cessor_messages.xml => 4225_plugin_processor_allowed_messages.xml} | 4 ++--
src/changelog/.2.x.x/4225_plugin_processor_messages.xml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/changelog/.2.x.x/4225_plugin_processor_messages.xml b/src/changelog/.2.x.x/4225_plugin_processor_allowed_messages.xml
similarity index 65%
copy from src/changelog/.2.x.x/4225_plugin_processor_messages.xml
copy to src/changelog/.2.x.x/4225_plugin_processor_allowed_messages.xml
index f52ac661a7..aace07fd43 100644
--- a/src/changelog/.2.x.x/4225_plugin_processor_messages.xml
+++ b/src/changelog/.2.x.x/4225_plugin_processor_allowed_messages.xml
@@ -6,8 +6,8 @@
https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="changed">
<issue id="4225" link="https://github.com/apache/logging-log4j2/issues/4225"/>
- <issue id="4228" link="https://github.com/apache/logging-log4j2/pull/4228"/>
+ <issue id="X" link="https://github.com/apache/logging-log4j2/pull/X"/>
<description format="asciidoc">
- Allow `log4j.plugin.processor.minAllowedMessageKind` to filter `GraalVmProcessor` diagnostics and prefix all plugin processor messages with `[Log4j]`.
+ Switch the default minimum allowed plugin processor message severity from NOTE to ERROR
</description>
</entry>
diff --git a/src/changelog/.2.x.x/4225_plugin_processor_messages.xml b/src/changelog/.2.x.x/4225_plugin_processor_messages.xml
index f52ac661a7..9a8eb33686 100644
--- a/src/changelog/.2.x.x/4225_plugin_processor_messages.xml
+++ b/src/changelog/.2.x.x/4225_plugin_processor_messages.xml
@@ -4,7 +4,7 @@
xsi:schemaLocation="
https://logging.apache.org/xml/ns
https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
- type="changed">
+ type="fixed">
<issue id="4225" link="https://github.com/apache/logging-log4j2/issues/4225"/>
<issue id="4228" link="https://github.com/apache/logging-log4j2/pull/4228"/>
<description format="asciidoc">