You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "jvz (via GitHub)" <gi...@apache.org> on 2025/08/15 17:39:49 UTC
[PR] Port GraalVM reachability to 3.x [logging-log4j2]
jvz opened a new pull request, #3884:
URL: https://github.com/apache/logging-log4j2/pull/3884
This resolves #3055 by porting #3053. I've ported the annotation processor from 2.x and did some refactoring of the other annotation processor to work more like this new one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Port GraalVM reachability to 3.x [logging-log4j2]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz merged PR #3884:
URL: https://github.com/apache/logging-log4j2/pull/3884
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Port GraalVM reachability to 3.x [logging-log4j2]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #3884:
URL: https://github.com/apache/logging-log4j2/pull/3884#discussion_r2454130862
##########
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java:
##########
@@ -101,24 +103,44 @@ private void loadPlugins(final ClassLoader classLoader, final Namespaces namespa
private Namespaces decodeCacheFiles(final ClassLoader classLoader) {
final long startTime = System.nanoTime();
- final PluginCache cache = new PluginCache();
+ final PluginIndex index = new PluginIndex();
try {
final Enumeration<URL> resources = classLoader.getResources(PLUGIN_CACHE_FILE);
if (resources == null) {
LOGGER.info("Plugin preloads not available from class loader {}", classLoader);
} else {
- cache.loadCacheFiles(resources);
+ while (resources.hasMoreElements()) {
+ final URL url = resources.nextElement();
+ try (final DataInputStream in = new DataInputStream(new BufferedInputStream(url.openStream()))) {
+ final int count = in.readInt();
+ for (int i = 0; i < count; i++) {
+ final var builder = PluginEntry.builder().setNamespace(in.readUTF());
+ final int entries = in.readInt();
+ for (int j = 0; j < entries; j++) {
+ // Must always read all parts of the entry, even if not adding, so that the stream
+ // progresses
+ final var entry = builder.setKey(in.readUTF())
+ .setClassName(in.readUTF())
+ .setName(in.readUTF())
+ .setPrintable(in.readBoolean())
+ .setDeferChildren(in.readBoolean())
+ .get();
+ index.add(entry);
+ }
+ }
+ }
+ }
Review Comment:
I don't see how the changes to `log4j-plugins` are relevant to this PR. Could you revert them?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Port GraalVM reachability to 3.x [logging-log4j2]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #3884:
URL: https://github.com/apache/logging-log4j2/pull/3884#discussion_r2462660293
##########
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java:
##########
@@ -101,24 +103,44 @@ private void loadPlugins(final ClassLoader classLoader, final Namespaces namespa
private Namespaces decodeCacheFiles(final ClassLoader classLoader) {
final long startTime = System.nanoTime();
- final PluginCache cache = new PluginCache();
+ final PluginIndex index = new PluginIndex();
try {
final Enumeration<URL> resources = classLoader.getResources(PLUGIN_CACHE_FILE);
if (resources == null) {
LOGGER.info("Plugin preloads not available from class loader {}", classLoader);
} else {
- cache.loadCacheFiles(resources);
+ while (resources.hasMoreElements()) {
+ final URL url = resources.nextElement();
+ try (final DataInputStream in = new DataInputStream(new BufferedInputStream(url.openStream()))) {
+ final int count = in.readInt();
+ for (int i = 0; i < count; i++) {
+ final var builder = PluginEntry.builder().setNamespace(in.readUTF());
+ final int entries = in.readInt();
+ for (int j = 0; j < entries; j++) {
+ // Must always read all parts of the entry, even if not adding, so that the stream
+ // progresses
+ final var entry = builder.setKey(in.readUTF())
+ .setClassName(in.readUTF())
+ .setName(in.readUTF())
+ .setPrintable(in.readBoolean())
+ .setDeferChildren(in.readBoolean())
+ .get();
+ index.add(entry);
+ }
+ }
+ }
+ }
Review Comment:
Since they are “trivial” they will be reviewed fast and they give you the opportunity to explain why the change is needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Port GraalVM reachability to 3.x [logging-log4j2]
Posted by "jvz (via GitHub)" <gi...@apache.org>.
jvz commented on code in PR #3884:
URL: https://github.com/apache/logging-log4j2/pull/3884#discussion_r2461431257
##########
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java:
##########
@@ -101,24 +103,44 @@ private void loadPlugins(final ClassLoader classLoader, final Namespaces namespa
private Namespaces decodeCacheFiles(final ClassLoader classLoader) {
final long startTime = System.nanoTime();
- final PluginCache cache = new PluginCache();
+ final PluginIndex index = new PluginIndex();
try {
final Enumeration<URL> resources = classLoader.getResources(PLUGIN_CACHE_FILE);
if (resources == null) {
LOGGER.info("Plugin preloads not available from class loader {}", classLoader);
} else {
- cache.loadCacheFiles(resources);
+ while (resources.hasMoreElements()) {
+ final URL url = resources.nextElement();
+ try (final DataInputStream in = new DataInputStream(new BufferedInputStream(url.openStream()))) {
+ final int count = in.readInt();
+ for (int i = 0; i < count; i++) {
+ final var builder = PluginEntry.builder().setNamespace(in.readUTF());
+ final int entries = in.readInt();
+ for (int j = 0; j < entries; j++) {
+ // Must always read all parts of the entry, even if not adding, so that the stream
+ // progresses
+ final var entry = builder.setKey(in.readUTF())
+ .setClassName(in.readUTF())
+ .setName(in.readUTF())
+ .setPrintable(in.readBoolean())
+ .setDeferChildren(in.readBoolean())
+ .get();
+ index.add(entry);
+ }
+ }
+ }
+ }
Review Comment:
This is an example of the type of trivial change that would have been simple to directly apply to the main branch but are now unable to do so without the formality of a PR and peer review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org