From 62e802d6d9a127c065a4bc0fa3158729e68df455 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 13 Jun 2025 18:25:52 +0200 Subject: [PATCH 01/31] Prepare release notes for `2.25.0` --- pom.xml | 10 +-- src/changelog/.2.x.x/.release-notes.adoc.ftl | 34 +--------- ..._co_elastic_clients_elasticsearch_java.xml | 8 --- ...e_co_elastic_logging_log4j2_ecs_layout.xml | 8 --- .../update_com_code_intelligence_jazzer.xml | 8 --- .../.2.x.x/update_com_github_jnr_jnr_ffi.xml | 8 --- .../update_com_github_luben_zstd_jni.xml | 8 --- .../.2.x.x/update_com_google_guava_guava.xml | 8 --- .../update_commons_codec_commons_codec.xml | 8 --- .../.2.x.x/update_commons_io_commons_io.xml | 8 --- .../.2.x.x/update_fast_xml_parser.xml | 8 --- .../update_gradle_develocity_actions.xml | 8 --- .../.2.x.x/update_net_java_dev_jna_jna.xml | 8 --- ...te_org_apache_activemq_activemq_broker.xml | 8 --- .../update_org_apache_groovy_groovy_bom.xml | 8 --- ...ransform_maven_shade_plugin_extensions.xml | 8 --- .../update_org_apache_maven_maven_core.xml | 8 --- ...apache_maven_surefire_surefire_junit47.xml | 8 --- .../update_org_assertj_assertj_core.xml | 8 --- .../update_org_awaitility_awaitility.xml | 8 --- ...pdate_org_codehaus_plexus_plexus_utils.xml | 8 --- ..._org_eclipse_platform_org_eclipse_osgi.xml | 8 --- .../.2.x.x/update_org_hsqldb_hsqldb.xml | 8 --- src/changelog/.2.x.x/update_org_json_json.xml | 8 --- .../.2.x.x/update_org_junit_junit_bom.xml | 8 --- ...pdate_org_openjdk_nashorn_nashorn_core.xml | 8 --- ...openrewrite_maven_rewrite_maven_plugin.xml | 8 --- ...rite_recipe_rewrite_logging_frameworks.xml | 8 --- ...penrewrite_recipe_rewrite_migrate_java.xml | 8 --- ...e_org_ops4j_pax_exam_exam_maven_plugin.xml | 8 --- .../update_org_ops4j_pax_exam_pax_exam.xml | 8 --- .../.2.x.x/update_org_slf4j_slf4j_nop.xml | 8 --- .../update_org_xmlunit_xmlunit_core.xml | 8 --- src/changelog/2.25.0/.release-notes.adoc.ftl | 68 +++++++++++++++++++ src/changelog/2.25.0/.release.xml | 21 ++++++ .../1736_split_jansi_support.xml | 0 .../2229_mongodb_docker.xml | 0 .../2295_add_JMS_Jakarta_Appender.xml | 0 ...llingFileManager_unsuccessful_rollover.xml | 0 ...ange_PatternLayout_exception_rendering.xml | 0 .../2691_deprecate_ThrowableProxy.xml | 0 ..._fix_PatternLayout_exception_rendering.xml | 0 .../2767_reload_key_stores.xml | 0 .../2767_simplify_SSL_config_logic.xml | 0 ...69_pluginAttribute_publicSetterWarning.xml | 0 .../2916_rewrite_jansi_renderer.xml | 0 ...ate_AbstractLogger_checkMessageFactory.xml | 0 .../{.2.x.x => 2.25.0}/2937-http-watcher.xml | 0 .../2942_fix_ThreadContext_putAll.xml | 0 .../{.2.x.x => 2.25.0}/2949_add_fuzzing.xml | 0 .../3011_http_appender_validation.xml | 0 .../3030_fix_log4j1_getLogger.xml | 0 .../3045_change_PatternLayout_prefix.xml | 0 .../3045_fix_PatternLayout_rEx_property.xml | 0 .../3045_remove_PatternLayout_ex_ansi.xml | 0 .../3048_fix_ThreadContext_remove.xml | 0 .../3053_graalvm_processor.xml | 0 .../3056_android_support.xml | 0 .../{.2.x.x => 2.25.0}/3066_fix_bom.xml | 0 .../3074_monitor_additional_files.xml | 0 .../3085_fix_log4j_1_priority.xml | 0 .../3118_default_layout.xml | 0 .../3119_set_level_call_parent.xml | 0 .../3121_deprecate_FixedDateFormat.xml | 0 .../3121_instant_format.xml | 0 ...hange_PatternLayout_exception_renderer.xml | 0 ...DBC_appender_IOException_stream_closed.xml | 0 .../3143_logger_registry.xml | 0 .../3149_change_StatusData_prefix.xml | 0 ...x_mongodb_appender_deprecation_warning.xml | 0 .../3153_fix_StringMatchFilter_guardNPE.xml | 0 ...syncWaitStrategyFactoryConfig_guardNPE.xml | 0 .../3206_fix_rootLogger_shorthand_npe.xml | 0 .../3212_fix_JTL_StackTraceStringResolver.xml | 0 .../3215_fix-RegexReplacement.xml | 0 .../{.2.x.x => 2.25.0}/3217_precise_clock.xml | 0 ...257_fix_AsyncAppender_requiresLocation.xml | 0 ..._fix_FailoverAppender_requiresLocation.xml | 0 .../{.2.x.x => 2.25.0}/3300_fix-javadoc.xml | 0 .../{.2.x.x => 2.25.0}/3359_fix-javadoc.xml | 0 ..._fix_typo_in_RootLogger_Builder_method.xml | 0 .../3398_fix_JTL_RecyclerFactoryConverter.xml | 0 .../3399_logger_registry.xml | 0 ...rnalLoggerRegistry_stale_entry_expunge.xml | 0 .../3431_default_config_name.xml | 0 ...37_transtive_compile_only_dependencies.xml | 0 .../3467_add_mongodb_conn_db_name.xml | 0 .../3508_LoggerContext_shutdownDisable.xml | 0 .../3562_StatusData_ArrayIndexOutOfBounds.xml | 0 .../3586_improve_GcpLayout.xml | 0 ...601_deprecate_or_remove_hiding_methods.xml | 0 ...timization_for_filling_the_stack_trace.xml | 0 .../3645_speedup_array_logging.xml | 0 ...ck_traces_in_ExtendedThreadInformation.xml | 0 ...665_fix_StatusLogger_writing_to_stdout.xml | 0 ..._generalize_ReadOnlyStringMap_equality.xml | 0 ...ase64_directly_instead_of_reflectively.xml | 0 .../3706_osgi-disruptor.xml | 0 .../fix_JsonWriter_surrogate_handling.xml | 0 .../throwable-proxy-clean-up.xml | 0 .../update_actions_stale.xml | 0 .../update_ch_qos_logback_logback_core.xml | 0 ...date_com_fasterxml_jackson_jackson_bom.xml | 0 ...m_github_spotbugs_spotbugs_annotations.xml | 0 .../update_io_fabric8_docker_maven_plugin.xml | 0 ...ate_org_apache_cassandra_cassandra_all.xml | 0 .../update_org_apache_commons_commons_csv.xml | 0 ...pdate_org_apache_commons_commons_dbcp2.xml | 0 ...pdate_org_apache_commons_commons_pool2.xml | 0 .../update_org_apache_kafka_kafka_clients.xml | 0 ...date_org_apache_logging_logging_parent.xml | 2 +- .../update_org_apache_tomcat_tomcat_juli.xml | 0 .../update_org_eclipse_jetty_jetty_util.xml | 0 .../update_org_jmdns_jmdns.xml | 0 .../update_org_mongodb_bson.xml | 0 .../update_org_slf4j_slf4j_api.xml | 0 ...ngframework_cloud_spring_cloud_context.xml | 0 117 files changed, 96 insertions(+), 287 deletions(-) delete mode 100644 src/changelog/.2.x.x/update_co_elastic_clients_elasticsearch_java.xml delete mode 100644 src/changelog/.2.x.x/update_co_elastic_logging_log4j2_ecs_layout.xml delete mode 100644 src/changelog/.2.x.x/update_com_code_intelligence_jazzer.xml delete mode 100644 src/changelog/.2.x.x/update_com_github_jnr_jnr_ffi.xml delete mode 100644 src/changelog/.2.x.x/update_com_github_luben_zstd_jni.xml delete mode 100644 src/changelog/.2.x.x/update_com_google_guava_guava.xml delete mode 100644 src/changelog/.2.x.x/update_commons_codec_commons_codec.xml delete mode 100644 src/changelog/.2.x.x/update_commons_io_commons_io.xml delete mode 100644 src/changelog/.2.x.x/update_fast_xml_parser.xml delete mode 100644 src/changelog/.2.x.x/update_gradle_develocity_actions.xml delete mode 100644 src/changelog/.2.x.x/update_net_java_dev_jna_jna.xml delete mode 100644 src/changelog/.2.x.x/update_org_apache_activemq_activemq_broker.xml delete mode 100644 src/changelog/.2.x.x/update_org_apache_groovy_groovy_bom.xml delete mode 100644 src/changelog/.2.x.x/update_org_apache_logging_log4j_log4j_transform_maven_shade_plugin_extensions.xml delete mode 100644 src/changelog/.2.x.x/update_org_apache_maven_maven_core.xml delete mode 100644 src/changelog/.2.x.x/update_org_apache_maven_surefire_surefire_junit47.xml delete mode 100644 src/changelog/.2.x.x/update_org_assertj_assertj_core.xml delete mode 100644 src/changelog/.2.x.x/update_org_awaitility_awaitility.xml delete mode 100644 src/changelog/.2.x.x/update_org_codehaus_plexus_plexus_utils.xml delete mode 100644 src/changelog/.2.x.x/update_org_eclipse_platform_org_eclipse_osgi.xml delete mode 100644 src/changelog/.2.x.x/update_org_hsqldb_hsqldb.xml delete mode 100644 src/changelog/.2.x.x/update_org_json_json.xml delete mode 100644 src/changelog/.2.x.x/update_org_junit_junit_bom.xml delete mode 100644 src/changelog/.2.x.x/update_org_openjdk_nashorn_nashorn_core.xml delete mode 100644 src/changelog/.2.x.x/update_org_openrewrite_maven_rewrite_maven_plugin.xml delete mode 100644 src/changelog/.2.x.x/update_org_openrewrite_recipe_rewrite_logging_frameworks.xml delete mode 100644 src/changelog/.2.x.x/update_org_openrewrite_recipe_rewrite_migrate_java.xml delete mode 100644 src/changelog/.2.x.x/update_org_ops4j_pax_exam_exam_maven_plugin.xml delete mode 100644 src/changelog/.2.x.x/update_org_ops4j_pax_exam_pax_exam.xml delete mode 100644 src/changelog/.2.x.x/update_org_slf4j_slf4j_nop.xml delete mode 100644 src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml create mode 100644 src/changelog/2.25.0/.release-notes.adoc.ftl create mode 100644 src/changelog/2.25.0/.release.xml rename src/changelog/{.2.x.x => 2.25.0}/1736_split_jansi_support.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2229_mongodb_docker.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2295_add_JMS_Jakarta_Appender.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2592_fix_RollingFileManager_unsuccessful_rollover.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2691_change_PatternLayout_exception_rendering.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2691_deprecate_ThrowableProxy.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2691_fix_PatternLayout_exception_rendering.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2767_reload_key_stores.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2767_simplify_SSL_config_logic.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2769_pluginAttribute_publicSetterWarning.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2916_rewrite_jansi_renderer.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2936_deprecate_AbstractLogger_checkMessageFactory.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2937-http-watcher.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2942_fix_ThreadContext_putAll.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/2949_add_fuzzing.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3011_http_appender_validation.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3030_fix_log4j1_getLogger.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3045_change_PatternLayout_prefix.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3045_fix_PatternLayout_rEx_property.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3045_remove_PatternLayout_ex_ansi.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3048_fix_ThreadContext_remove.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3053_graalvm_processor.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3056_android_support.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3066_fix_bom.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3074_monitor_additional_files.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3085_fix_log4j_1_priority.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3118_default_layout.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3119_set_level_call_parent.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3121_deprecate_FixedDateFormat.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3121_instant_format.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3123_change_PatternLayout_exception_renderer.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3127_JDBC_appender_IOException_stream_closed.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3143_logger_registry.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3149_change_StatusData_prefix.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3151_fix_mongodb_appender_deprecation_warning.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3153_fix_StringMatchFilter_guardNPE.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3159_fix_AsyncWaitStrategyFactoryConfig_guardNPE.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3206_fix_rootLogger_shorthand_npe.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3212_fix_JTL_StackTraceStringResolver.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3215_fix-RegexReplacement.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3217_precise_clock.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3257_fix_AsyncAppender_requiresLocation.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3257_fix_FailoverAppender_requiresLocation.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3300_fix-javadoc.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3359_fix-javadoc.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3369_fix_typo_in_RootLogger_Builder_method.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3398_fix_JTL_RecyclerFactoryConverter.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3399_logger_registry.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3430_InternalLoggerRegistry_stale_entry_expunge.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3431_default_config_name.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3437_transtive_compile_only_dependencies.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3467_add_mongodb_conn_db_name.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3508_LoggerContext_shutdownDisable.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3562_StatusData_ArrayIndexOutOfBounds.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3586_improve_GcpLayout.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3601_deprecate_or_remove_hiding_methods.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3639_disable_optimization_for_filling_the_stack_trace.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3645_speedup_array_logging.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3655_handle_missing_stack_traces_in_ExtendedThreadInformation.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3665_fix_StatusLogger_writing_to_stdout.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3669_generalize_ReadOnlyStringMap_equality.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3686_invoke_java_util_base64_directly_instead_of_reflectively.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/3706_osgi-disruptor.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/fix_JsonWriter_surrogate_handling.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/throwable-proxy-clean-up.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_actions_stale.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_ch_qos_logback_logback_core.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_com_fasterxml_jackson_jackson_bom.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_com_github_spotbugs_spotbugs_annotations.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_io_fabric8_docker_maven_plugin.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_cassandra_cassandra_all.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_commons_commons_csv.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_commons_commons_dbcp2.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_commons_commons_pool2.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_kafka_kafka_clients.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_logging_logging_parent.xml (88%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_apache_tomcat_tomcat_juli.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_eclipse_jetty_jetty_util.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_jmdns_jmdns.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_mongodb_bson.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_slf4j_slf4j_api.xml (100%) rename src/changelog/{.2.x.x => 2.25.0}/update_org_springframework_cloud_spring_cloud_context.xml (100%) diff --git a/pom.xml b/pom.xml index 3de3452381d..a336379dcb5 100644 --- a/pom.xml +++ b/pom.xml @@ -279,7 +279,7 @@ scm:git:https://github.com/apache/logging-log4j2.git scm:git:https://github.com/apache/logging-log4j2.git - 2.x + rel/2.25.0 https://github.com/apache/logging-log4j2 @@ -307,11 +307,11 @@ - 2.25.0-SNAPSHOT + 2.25.0 - 2.24.3 - 2.24.3 - 2.24.3 + 2.25.0 + 2.25.0 + 2.25.0 + diff --git a/src/changelog/.2.x.x/1736_split_jansi_support.xml b/src/changelog/2.25.0/1736_split_jansi_support.xml similarity index 100% rename from src/changelog/.2.x.x/1736_split_jansi_support.xml rename to src/changelog/2.25.0/1736_split_jansi_support.xml diff --git a/src/changelog/.2.x.x/2229_mongodb_docker.xml b/src/changelog/2.25.0/2229_mongodb_docker.xml similarity index 100% rename from src/changelog/.2.x.x/2229_mongodb_docker.xml rename to src/changelog/2.25.0/2229_mongodb_docker.xml diff --git a/src/changelog/.2.x.x/2295_add_JMS_Jakarta_Appender.xml b/src/changelog/2.25.0/2295_add_JMS_Jakarta_Appender.xml similarity index 100% rename from src/changelog/.2.x.x/2295_add_JMS_Jakarta_Appender.xml rename to src/changelog/2.25.0/2295_add_JMS_Jakarta_Appender.xml diff --git a/src/changelog/.2.x.x/2592_fix_RollingFileManager_unsuccessful_rollover.xml b/src/changelog/2.25.0/2592_fix_RollingFileManager_unsuccessful_rollover.xml similarity index 100% rename from src/changelog/.2.x.x/2592_fix_RollingFileManager_unsuccessful_rollover.xml rename to src/changelog/2.25.0/2592_fix_RollingFileManager_unsuccessful_rollover.xml diff --git a/src/changelog/.2.x.x/2691_change_PatternLayout_exception_rendering.xml b/src/changelog/2.25.0/2691_change_PatternLayout_exception_rendering.xml similarity index 100% rename from src/changelog/.2.x.x/2691_change_PatternLayout_exception_rendering.xml rename to src/changelog/2.25.0/2691_change_PatternLayout_exception_rendering.xml diff --git a/src/changelog/.2.x.x/2691_deprecate_ThrowableProxy.xml b/src/changelog/2.25.0/2691_deprecate_ThrowableProxy.xml similarity index 100% rename from src/changelog/.2.x.x/2691_deprecate_ThrowableProxy.xml rename to src/changelog/2.25.0/2691_deprecate_ThrowableProxy.xml diff --git a/src/changelog/.2.x.x/2691_fix_PatternLayout_exception_rendering.xml b/src/changelog/2.25.0/2691_fix_PatternLayout_exception_rendering.xml similarity index 100% rename from src/changelog/.2.x.x/2691_fix_PatternLayout_exception_rendering.xml rename to src/changelog/2.25.0/2691_fix_PatternLayout_exception_rendering.xml diff --git a/src/changelog/.2.x.x/2767_reload_key_stores.xml b/src/changelog/2.25.0/2767_reload_key_stores.xml similarity index 100% rename from src/changelog/.2.x.x/2767_reload_key_stores.xml rename to src/changelog/2.25.0/2767_reload_key_stores.xml diff --git a/src/changelog/.2.x.x/2767_simplify_SSL_config_logic.xml b/src/changelog/2.25.0/2767_simplify_SSL_config_logic.xml similarity index 100% rename from src/changelog/.2.x.x/2767_simplify_SSL_config_logic.xml rename to src/changelog/2.25.0/2767_simplify_SSL_config_logic.xml diff --git a/src/changelog/.2.x.x/2769_pluginAttribute_publicSetterWarning.xml b/src/changelog/2.25.0/2769_pluginAttribute_publicSetterWarning.xml similarity index 100% rename from src/changelog/.2.x.x/2769_pluginAttribute_publicSetterWarning.xml rename to src/changelog/2.25.0/2769_pluginAttribute_publicSetterWarning.xml diff --git a/src/changelog/.2.x.x/2916_rewrite_jansi_renderer.xml b/src/changelog/2.25.0/2916_rewrite_jansi_renderer.xml similarity index 100% rename from src/changelog/.2.x.x/2916_rewrite_jansi_renderer.xml rename to src/changelog/2.25.0/2916_rewrite_jansi_renderer.xml diff --git a/src/changelog/.2.x.x/2936_deprecate_AbstractLogger_checkMessageFactory.xml b/src/changelog/2.25.0/2936_deprecate_AbstractLogger_checkMessageFactory.xml similarity index 100% rename from src/changelog/.2.x.x/2936_deprecate_AbstractLogger_checkMessageFactory.xml rename to src/changelog/2.25.0/2936_deprecate_AbstractLogger_checkMessageFactory.xml diff --git a/src/changelog/.2.x.x/2937-http-watcher.xml b/src/changelog/2.25.0/2937-http-watcher.xml similarity index 100% rename from src/changelog/.2.x.x/2937-http-watcher.xml rename to src/changelog/2.25.0/2937-http-watcher.xml diff --git a/src/changelog/.2.x.x/2942_fix_ThreadContext_putAll.xml b/src/changelog/2.25.0/2942_fix_ThreadContext_putAll.xml similarity index 100% rename from src/changelog/.2.x.x/2942_fix_ThreadContext_putAll.xml rename to src/changelog/2.25.0/2942_fix_ThreadContext_putAll.xml diff --git a/src/changelog/.2.x.x/2949_add_fuzzing.xml b/src/changelog/2.25.0/2949_add_fuzzing.xml similarity index 100% rename from src/changelog/.2.x.x/2949_add_fuzzing.xml rename to src/changelog/2.25.0/2949_add_fuzzing.xml diff --git a/src/changelog/.2.x.x/3011_http_appender_validation.xml b/src/changelog/2.25.0/3011_http_appender_validation.xml similarity index 100% rename from src/changelog/.2.x.x/3011_http_appender_validation.xml rename to src/changelog/2.25.0/3011_http_appender_validation.xml diff --git a/src/changelog/.2.x.x/3030_fix_log4j1_getLogger.xml b/src/changelog/2.25.0/3030_fix_log4j1_getLogger.xml similarity index 100% rename from src/changelog/.2.x.x/3030_fix_log4j1_getLogger.xml rename to src/changelog/2.25.0/3030_fix_log4j1_getLogger.xml diff --git a/src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml b/src/changelog/2.25.0/3045_change_PatternLayout_prefix.xml similarity index 100% rename from src/changelog/.2.x.x/3045_change_PatternLayout_prefix.xml rename to src/changelog/2.25.0/3045_change_PatternLayout_prefix.xml diff --git a/src/changelog/.2.x.x/3045_fix_PatternLayout_rEx_property.xml b/src/changelog/2.25.0/3045_fix_PatternLayout_rEx_property.xml similarity index 100% rename from src/changelog/.2.x.x/3045_fix_PatternLayout_rEx_property.xml rename to src/changelog/2.25.0/3045_fix_PatternLayout_rEx_property.xml diff --git a/src/changelog/.2.x.x/3045_remove_PatternLayout_ex_ansi.xml b/src/changelog/2.25.0/3045_remove_PatternLayout_ex_ansi.xml similarity index 100% rename from src/changelog/.2.x.x/3045_remove_PatternLayout_ex_ansi.xml rename to src/changelog/2.25.0/3045_remove_PatternLayout_ex_ansi.xml diff --git a/src/changelog/.2.x.x/3048_fix_ThreadContext_remove.xml b/src/changelog/2.25.0/3048_fix_ThreadContext_remove.xml similarity index 100% rename from src/changelog/.2.x.x/3048_fix_ThreadContext_remove.xml rename to src/changelog/2.25.0/3048_fix_ThreadContext_remove.xml diff --git a/src/changelog/.2.x.x/3053_graalvm_processor.xml b/src/changelog/2.25.0/3053_graalvm_processor.xml similarity index 100% rename from src/changelog/.2.x.x/3053_graalvm_processor.xml rename to src/changelog/2.25.0/3053_graalvm_processor.xml diff --git a/src/changelog/.2.x.x/3056_android_support.xml b/src/changelog/2.25.0/3056_android_support.xml similarity index 100% rename from src/changelog/.2.x.x/3056_android_support.xml rename to src/changelog/2.25.0/3056_android_support.xml diff --git a/src/changelog/.2.x.x/3066_fix_bom.xml b/src/changelog/2.25.0/3066_fix_bom.xml similarity index 100% rename from src/changelog/.2.x.x/3066_fix_bom.xml rename to src/changelog/2.25.0/3066_fix_bom.xml diff --git a/src/changelog/.2.x.x/3074_monitor_additional_files.xml b/src/changelog/2.25.0/3074_monitor_additional_files.xml similarity index 100% rename from src/changelog/.2.x.x/3074_monitor_additional_files.xml rename to src/changelog/2.25.0/3074_monitor_additional_files.xml diff --git a/src/changelog/.2.x.x/3085_fix_log4j_1_priority.xml b/src/changelog/2.25.0/3085_fix_log4j_1_priority.xml similarity index 100% rename from src/changelog/.2.x.x/3085_fix_log4j_1_priority.xml rename to src/changelog/2.25.0/3085_fix_log4j_1_priority.xml diff --git a/src/changelog/.2.x.x/3118_default_layout.xml b/src/changelog/2.25.0/3118_default_layout.xml similarity index 100% rename from src/changelog/.2.x.x/3118_default_layout.xml rename to src/changelog/2.25.0/3118_default_layout.xml diff --git a/src/changelog/.2.x.x/3119_set_level_call_parent.xml b/src/changelog/2.25.0/3119_set_level_call_parent.xml similarity index 100% rename from src/changelog/.2.x.x/3119_set_level_call_parent.xml rename to src/changelog/2.25.0/3119_set_level_call_parent.xml diff --git a/src/changelog/.2.x.x/3121_deprecate_FixedDateFormat.xml b/src/changelog/2.25.0/3121_deprecate_FixedDateFormat.xml similarity index 100% rename from src/changelog/.2.x.x/3121_deprecate_FixedDateFormat.xml rename to src/changelog/2.25.0/3121_deprecate_FixedDateFormat.xml diff --git a/src/changelog/.2.x.x/3121_instant_format.xml b/src/changelog/2.25.0/3121_instant_format.xml similarity index 100% rename from src/changelog/.2.x.x/3121_instant_format.xml rename to src/changelog/2.25.0/3121_instant_format.xml diff --git a/src/changelog/.2.x.x/3123_change_PatternLayout_exception_renderer.xml b/src/changelog/2.25.0/3123_change_PatternLayout_exception_renderer.xml similarity index 100% rename from src/changelog/.2.x.x/3123_change_PatternLayout_exception_renderer.xml rename to src/changelog/2.25.0/3123_change_PatternLayout_exception_renderer.xml diff --git a/src/changelog/.2.x.x/3127_JDBC_appender_IOException_stream_closed.xml b/src/changelog/2.25.0/3127_JDBC_appender_IOException_stream_closed.xml similarity index 100% rename from src/changelog/.2.x.x/3127_JDBC_appender_IOException_stream_closed.xml rename to src/changelog/2.25.0/3127_JDBC_appender_IOException_stream_closed.xml diff --git a/src/changelog/.2.x.x/3143_logger_registry.xml b/src/changelog/2.25.0/3143_logger_registry.xml similarity index 100% rename from src/changelog/.2.x.x/3143_logger_registry.xml rename to src/changelog/2.25.0/3143_logger_registry.xml diff --git a/src/changelog/.2.x.x/3149_change_StatusData_prefix.xml b/src/changelog/2.25.0/3149_change_StatusData_prefix.xml similarity index 100% rename from src/changelog/.2.x.x/3149_change_StatusData_prefix.xml rename to src/changelog/2.25.0/3149_change_StatusData_prefix.xml diff --git a/src/changelog/.2.x.x/3151_fix_mongodb_appender_deprecation_warning.xml b/src/changelog/2.25.0/3151_fix_mongodb_appender_deprecation_warning.xml similarity index 100% rename from src/changelog/.2.x.x/3151_fix_mongodb_appender_deprecation_warning.xml rename to src/changelog/2.25.0/3151_fix_mongodb_appender_deprecation_warning.xml diff --git a/src/changelog/.2.x.x/3153_fix_StringMatchFilter_guardNPE.xml b/src/changelog/2.25.0/3153_fix_StringMatchFilter_guardNPE.xml similarity index 100% rename from src/changelog/.2.x.x/3153_fix_StringMatchFilter_guardNPE.xml rename to src/changelog/2.25.0/3153_fix_StringMatchFilter_guardNPE.xml diff --git a/src/changelog/.2.x.x/3159_fix_AsyncWaitStrategyFactoryConfig_guardNPE.xml b/src/changelog/2.25.0/3159_fix_AsyncWaitStrategyFactoryConfig_guardNPE.xml similarity index 100% rename from src/changelog/.2.x.x/3159_fix_AsyncWaitStrategyFactoryConfig_guardNPE.xml rename to src/changelog/2.25.0/3159_fix_AsyncWaitStrategyFactoryConfig_guardNPE.xml diff --git a/src/changelog/.2.x.x/3206_fix_rootLogger_shorthand_npe.xml b/src/changelog/2.25.0/3206_fix_rootLogger_shorthand_npe.xml similarity index 100% rename from src/changelog/.2.x.x/3206_fix_rootLogger_shorthand_npe.xml rename to src/changelog/2.25.0/3206_fix_rootLogger_shorthand_npe.xml diff --git a/src/changelog/.2.x.x/3212_fix_JTL_StackTraceStringResolver.xml b/src/changelog/2.25.0/3212_fix_JTL_StackTraceStringResolver.xml similarity index 100% rename from src/changelog/.2.x.x/3212_fix_JTL_StackTraceStringResolver.xml rename to src/changelog/2.25.0/3212_fix_JTL_StackTraceStringResolver.xml diff --git a/src/changelog/.2.x.x/3215_fix-RegexReplacement.xml b/src/changelog/2.25.0/3215_fix-RegexReplacement.xml similarity index 100% rename from src/changelog/.2.x.x/3215_fix-RegexReplacement.xml rename to src/changelog/2.25.0/3215_fix-RegexReplacement.xml diff --git a/src/changelog/.2.x.x/3217_precise_clock.xml b/src/changelog/2.25.0/3217_precise_clock.xml similarity index 100% rename from src/changelog/.2.x.x/3217_precise_clock.xml rename to src/changelog/2.25.0/3217_precise_clock.xml diff --git a/src/changelog/.2.x.x/3257_fix_AsyncAppender_requiresLocation.xml b/src/changelog/2.25.0/3257_fix_AsyncAppender_requiresLocation.xml similarity index 100% rename from src/changelog/.2.x.x/3257_fix_AsyncAppender_requiresLocation.xml rename to src/changelog/2.25.0/3257_fix_AsyncAppender_requiresLocation.xml diff --git a/src/changelog/.2.x.x/3257_fix_FailoverAppender_requiresLocation.xml b/src/changelog/2.25.0/3257_fix_FailoverAppender_requiresLocation.xml similarity index 100% rename from src/changelog/.2.x.x/3257_fix_FailoverAppender_requiresLocation.xml rename to src/changelog/2.25.0/3257_fix_FailoverAppender_requiresLocation.xml diff --git a/src/changelog/.2.x.x/3300_fix-javadoc.xml b/src/changelog/2.25.0/3300_fix-javadoc.xml similarity index 100% rename from src/changelog/.2.x.x/3300_fix-javadoc.xml rename to src/changelog/2.25.0/3300_fix-javadoc.xml diff --git a/src/changelog/.2.x.x/3359_fix-javadoc.xml b/src/changelog/2.25.0/3359_fix-javadoc.xml similarity index 100% rename from src/changelog/.2.x.x/3359_fix-javadoc.xml rename to src/changelog/2.25.0/3359_fix-javadoc.xml diff --git a/src/changelog/.2.x.x/3369_fix_typo_in_RootLogger_Builder_method.xml b/src/changelog/2.25.0/3369_fix_typo_in_RootLogger_Builder_method.xml similarity index 100% rename from src/changelog/.2.x.x/3369_fix_typo_in_RootLogger_Builder_method.xml rename to src/changelog/2.25.0/3369_fix_typo_in_RootLogger_Builder_method.xml diff --git a/src/changelog/.2.x.x/3398_fix_JTL_RecyclerFactoryConverter.xml b/src/changelog/2.25.0/3398_fix_JTL_RecyclerFactoryConverter.xml similarity index 100% rename from src/changelog/.2.x.x/3398_fix_JTL_RecyclerFactoryConverter.xml rename to src/changelog/2.25.0/3398_fix_JTL_RecyclerFactoryConverter.xml diff --git a/src/changelog/.2.x.x/3399_logger_registry.xml b/src/changelog/2.25.0/3399_logger_registry.xml similarity index 100% rename from src/changelog/.2.x.x/3399_logger_registry.xml rename to src/changelog/2.25.0/3399_logger_registry.xml diff --git a/src/changelog/.2.x.x/3430_InternalLoggerRegistry_stale_entry_expunge.xml b/src/changelog/2.25.0/3430_InternalLoggerRegistry_stale_entry_expunge.xml similarity index 100% rename from src/changelog/.2.x.x/3430_InternalLoggerRegistry_stale_entry_expunge.xml rename to src/changelog/2.25.0/3430_InternalLoggerRegistry_stale_entry_expunge.xml diff --git a/src/changelog/.2.x.x/3431_default_config_name.xml b/src/changelog/2.25.0/3431_default_config_name.xml similarity index 100% rename from src/changelog/.2.x.x/3431_default_config_name.xml rename to src/changelog/2.25.0/3431_default_config_name.xml diff --git a/src/changelog/.2.x.x/3437_transtive_compile_only_dependencies.xml b/src/changelog/2.25.0/3437_transtive_compile_only_dependencies.xml similarity index 100% rename from src/changelog/.2.x.x/3437_transtive_compile_only_dependencies.xml rename to src/changelog/2.25.0/3437_transtive_compile_only_dependencies.xml diff --git a/src/changelog/.2.x.x/3467_add_mongodb_conn_db_name.xml b/src/changelog/2.25.0/3467_add_mongodb_conn_db_name.xml similarity index 100% rename from src/changelog/.2.x.x/3467_add_mongodb_conn_db_name.xml rename to src/changelog/2.25.0/3467_add_mongodb_conn_db_name.xml diff --git a/src/changelog/.2.x.x/3508_LoggerContext_shutdownDisable.xml b/src/changelog/2.25.0/3508_LoggerContext_shutdownDisable.xml similarity index 100% rename from src/changelog/.2.x.x/3508_LoggerContext_shutdownDisable.xml rename to src/changelog/2.25.0/3508_LoggerContext_shutdownDisable.xml diff --git a/src/changelog/.2.x.x/3562_StatusData_ArrayIndexOutOfBounds.xml b/src/changelog/2.25.0/3562_StatusData_ArrayIndexOutOfBounds.xml similarity index 100% rename from src/changelog/.2.x.x/3562_StatusData_ArrayIndexOutOfBounds.xml rename to src/changelog/2.25.0/3562_StatusData_ArrayIndexOutOfBounds.xml diff --git a/src/changelog/.2.x.x/3586_improve_GcpLayout.xml b/src/changelog/2.25.0/3586_improve_GcpLayout.xml similarity index 100% rename from src/changelog/.2.x.x/3586_improve_GcpLayout.xml rename to src/changelog/2.25.0/3586_improve_GcpLayout.xml diff --git a/src/changelog/.2.x.x/3601_deprecate_or_remove_hiding_methods.xml b/src/changelog/2.25.0/3601_deprecate_or_remove_hiding_methods.xml similarity index 100% rename from src/changelog/.2.x.x/3601_deprecate_or_remove_hiding_methods.xml rename to src/changelog/2.25.0/3601_deprecate_or_remove_hiding_methods.xml diff --git a/src/changelog/.2.x.x/3639_disable_optimization_for_filling_the_stack_trace.xml b/src/changelog/2.25.0/3639_disable_optimization_for_filling_the_stack_trace.xml similarity index 100% rename from src/changelog/.2.x.x/3639_disable_optimization_for_filling_the_stack_trace.xml rename to src/changelog/2.25.0/3639_disable_optimization_for_filling_the_stack_trace.xml diff --git a/src/changelog/.2.x.x/3645_speedup_array_logging.xml b/src/changelog/2.25.0/3645_speedup_array_logging.xml similarity index 100% rename from src/changelog/.2.x.x/3645_speedup_array_logging.xml rename to src/changelog/2.25.0/3645_speedup_array_logging.xml diff --git a/src/changelog/.2.x.x/3655_handle_missing_stack_traces_in_ExtendedThreadInformation.xml b/src/changelog/2.25.0/3655_handle_missing_stack_traces_in_ExtendedThreadInformation.xml similarity index 100% rename from src/changelog/.2.x.x/3655_handle_missing_stack_traces_in_ExtendedThreadInformation.xml rename to src/changelog/2.25.0/3655_handle_missing_stack_traces_in_ExtendedThreadInformation.xml diff --git a/src/changelog/.2.x.x/3665_fix_StatusLogger_writing_to_stdout.xml b/src/changelog/2.25.0/3665_fix_StatusLogger_writing_to_stdout.xml similarity index 100% rename from src/changelog/.2.x.x/3665_fix_StatusLogger_writing_to_stdout.xml rename to src/changelog/2.25.0/3665_fix_StatusLogger_writing_to_stdout.xml diff --git a/src/changelog/.2.x.x/3669_generalize_ReadOnlyStringMap_equality.xml b/src/changelog/2.25.0/3669_generalize_ReadOnlyStringMap_equality.xml similarity index 100% rename from src/changelog/.2.x.x/3669_generalize_ReadOnlyStringMap_equality.xml rename to src/changelog/2.25.0/3669_generalize_ReadOnlyStringMap_equality.xml diff --git a/src/changelog/.2.x.x/3686_invoke_java_util_base64_directly_instead_of_reflectively.xml b/src/changelog/2.25.0/3686_invoke_java_util_base64_directly_instead_of_reflectively.xml similarity index 100% rename from src/changelog/.2.x.x/3686_invoke_java_util_base64_directly_instead_of_reflectively.xml rename to src/changelog/2.25.0/3686_invoke_java_util_base64_directly_instead_of_reflectively.xml diff --git a/src/changelog/.2.x.x/3706_osgi-disruptor.xml b/src/changelog/2.25.0/3706_osgi-disruptor.xml similarity index 100% rename from src/changelog/.2.x.x/3706_osgi-disruptor.xml rename to src/changelog/2.25.0/3706_osgi-disruptor.xml diff --git a/src/changelog/.2.x.x/fix_JsonWriter_surrogate_handling.xml b/src/changelog/2.25.0/fix_JsonWriter_surrogate_handling.xml similarity index 100% rename from src/changelog/.2.x.x/fix_JsonWriter_surrogate_handling.xml rename to src/changelog/2.25.0/fix_JsonWriter_surrogate_handling.xml diff --git a/src/changelog/.2.x.x/throwable-proxy-clean-up.xml b/src/changelog/2.25.0/throwable-proxy-clean-up.xml similarity index 100% rename from src/changelog/.2.x.x/throwable-proxy-clean-up.xml rename to src/changelog/2.25.0/throwable-proxy-clean-up.xml diff --git a/src/changelog/.2.x.x/update_actions_stale.xml b/src/changelog/2.25.0/update_actions_stale.xml similarity index 100% rename from src/changelog/.2.x.x/update_actions_stale.xml rename to src/changelog/2.25.0/update_actions_stale.xml diff --git a/src/changelog/.2.x.x/update_ch_qos_logback_logback_core.xml b/src/changelog/2.25.0/update_ch_qos_logback_logback_core.xml similarity index 100% rename from src/changelog/.2.x.x/update_ch_qos_logback_logback_core.xml rename to src/changelog/2.25.0/update_ch_qos_logback_logback_core.xml diff --git a/src/changelog/.2.x.x/update_com_fasterxml_jackson_jackson_bom.xml b/src/changelog/2.25.0/update_com_fasterxml_jackson_jackson_bom.xml similarity index 100% rename from src/changelog/.2.x.x/update_com_fasterxml_jackson_jackson_bom.xml rename to src/changelog/2.25.0/update_com_fasterxml_jackson_jackson_bom.xml diff --git a/src/changelog/.2.x.x/update_com_github_spotbugs_spotbugs_annotations.xml b/src/changelog/2.25.0/update_com_github_spotbugs_spotbugs_annotations.xml similarity index 100% rename from src/changelog/.2.x.x/update_com_github_spotbugs_spotbugs_annotations.xml rename to src/changelog/2.25.0/update_com_github_spotbugs_spotbugs_annotations.xml diff --git a/src/changelog/.2.x.x/update_io_fabric8_docker_maven_plugin.xml b/src/changelog/2.25.0/update_io_fabric8_docker_maven_plugin.xml similarity index 100% rename from src/changelog/.2.x.x/update_io_fabric8_docker_maven_plugin.xml rename to src/changelog/2.25.0/update_io_fabric8_docker_maven_plugin.xml diff --git a/src/changelog/.2.x.x/update_org_apache_cassandra_cassandra_all.xml b/src/changelog/2.25.0/update_org_apache_cassandra_cassandra_all.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_apache_cassandra_cassandra_all.xml rename to src/changelog/2.25.0/update_org_apache_cassandra_cassandra_all.xml diff --git a/src/changelog/.2.x.x/update_org_apache_commons_commons_csv.xml b/src/changelog/2.25.0/update_org_apache_commons_commons_csv.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_apache_commons_commons_csv.xml rename to src/changelog/2.25.0/update_org_apache_commons_commons_csv.xml diff --git a/src/changelog/.2.x.x/update_org_apache_commons_commons_dbcp2.xml b/src/changelog/2.25.0/update_org_apache_commons_commons_dbcp2.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_apache_commons_commons_dbcp2.xml rename to src/changelog/2.25.0/update_org_apache_commons_commons_dbcp2.xml diff --git a/src/changelog/.2.x.x/update_org_apache_commons_commons_pool2.xml b/src/changelog/2.25.0/update_org_apache_commons_commons_pool2.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_apache_commons_commons_pool2.xml rename to src/changelog/2.25.0/update_org_apache_commons_commons_pool2.xml diff --git a/src/changelog/.2.x.x/update_org_apache_kafka_kafka_clients.xml b/src/changelog/2.25.0/update_org_apache_kafka_kafka_clients.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_apache_kafka_kafka_clients.xml rename to src/changelog/2.25.0/update_org_apache_kafka_kafka_clients.xml diff --git a/src/changelog/.2.x.x/update_org_apache_logging_logging_parent.xml b/src/changelog/2.25.0/update_org_apache_logging_logging_parent.xml similarity index 88% rename from src/changelog/.2.x.x/update_org_apache_logging_logging_parent.xml rename to src/changelog/2.25.0/update_org_apache_logging_logging_parent.xml index 0ea7b563939..3dc20db50d0 100644 --- a/src/changelog/.2.x.x/update_org_apache_logging_logging_parent.xml +++ b/src/changelog/2.25.0/update_org_apache_logging_logging_parent.xml @@ -3,5 +3,5 @@ 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="updated"> - Update `org.apache.logging:logging-parent` to version `12.0.0` + Update `org.apache.logging:logging-parent` to version `12.1.1` diff --git a/src/changelog/.2.x.x/update_org_apache_tomcat_tomcat_juli.xml b/src/changelog/2.25.0/update_org_apache_tomcat_tomcat_juli.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_apache_tomcat_tomcat_juli.xml rename to src/changelog/2.25.0/update_org_apache_tomcat_tomcat_juli.xml diff --git a/src/changelog/.2.x.x/update_org_eclipse_jetty_jetty_util.xml b/src/changelog/2.25.0/update_org_eclipse_jetty_jetty_util.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_eclipse_jetty_jetty_util.xml rename to src/changelog/2.25.0/update_org_eclipse_jetty_jetty_util.xml diff --git a/src/changelog/.2.x.x/update_org_jmdns_jmdns.xml b/src/changelog/2.25.0/update_org_jmdns_jmdns.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_jmdns_jmdns.xml rename to src/changelog/2.25.0/update_org_jmdns_jmdns.xml diff --git a/src/changelog/.2.x.x/update_org_mongodb_bson.xml b/src/changelog/2.25.0/update_org_mongodb_bson.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_mongodb_bson.xml rename to src/changelog/2.25.0/update_org_mongodb_bson.xml diff --git a/src/changelog/.2.x.x/update_org_slf4j_slf4j_api.xml b/src/changelog/2.25.0/update_org_slf4j_slf4j_api.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_slf4j_slf4j_api.xml rename to src/changelog/2.25.0/update_org_slf4j_slf4j_api.xml diff --git a/src/changelog/.2.x.x/update_org_springframework_cloud_spring_cloud_context.xml b/src/changelog/2.25.0/update_org_springframework_cloud_spring_cloud_context.xml similarity index 100% rename from src/changelog/.2.x.x/update_org_springframework_cloud_spring_cloud_context.xml rename to src/changelog/2.25.0/update_org_springframework_cloud_spring_cloud_context.xml From c9fbc53323a1222a169b5028c950d87af887962d Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 13 Jun 2025 18:26:23 +0200 Subject: [PATCH 02/31] fix: use normalized form for new configuration property --- .../core/util/internal/instant/InstantPatternFormatter.java | 2 +- .../manual/systemproperties/properties-log4j-core-misc.adoc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternFormatter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternFormatter.java index e3fab77e188..785968c26e1 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternFormatter.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternFormatter.java @@ -40,7 +40,7 @@ public interface InstantPatternFormatter extends InstantFormatter { boolean LEGACY_FORMATTERS_ENABLED = - "legacy".equalsIgnoreCase(PropertiesUtil.getProperties().getStringProperty("log4j2.instant.formatter")); + "legacy".equalsIgnoreCase(PropertiesUtil.getProperties().getStringProperty("log4j2.instantFormatter")); String getPattern(); diff --git a/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-log4j-core-misc.adoc b/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-log4j-core-misc.adoc index e9a44de433b..fcb8ff4d706 100644 --- a/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-log4j-core-misc.adoc +++ b/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-log4j-core-misc.adoc @@ -262,8 +262,8 @@ link:../javadoc/log4j-api/org/apache/logging/log4j/message/FlowMessageFactory.ht implementation to be used by all loggers. // end::flow-tracing[] -[id=log4j2.instant.formatter] -== `log4j2.instant.formatter` +[id=log4j2.instantFormatter] +== `log4j2.instantFormatter` [cols="1h,5"] |=== From 75061eb9d266005c871eedaeab668faa2118ce7d Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 13 Jun 2025 19:08:55 +0200 Subject: [PATCH 03/31] fix: Javadoc and documentation problems --- .../map/UnmodifiableArrayBackedMap.java | 8 ----- src/changelog/2.25.0/.release-notes.adoc.ftl | 12 +++++-- .../pages/manual/appenders/message-queue.adoc | 35 +++++++++++++++++-- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/internal/map/UnmodifiableArrayBackedMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/internal/map/UnmodifiableArrayBackedMap.java index 45f61cefd9f..2911710bd3c 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/internal/map/UnmodifiableArrayBackedMap.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/internal/map/UnmodifiableArrayBackedMap.java @@ -269,10 +269,6 @@ public UnmodifiableArrayBackedMap copyAndPut(String key, String value) { /** * Creates a new instance that contains the same entries as this map, plus the * new entries or updated values passed in the parameters. - * - * @param key - * @param value - * @return */ public UnmodifiableArrayBackedMap copyAndPutAll(Map entriesToAdd) { // create a new array that can hold the maximum output size @@ -304,10 +300,6 @@ public UnmodifiableArrayBackedMap copyAndPutAll(Map entriesToAdd /** * Creates a new instance that contains the same entries as this map, minus the * entry with the specified key (if such an entry exists). - * - * @param key - * @param value - * @return */ public UnmodifiableArrayBackedMap copyAndRemove(String key) { int indexToRemove = -1; diff --git a/src/changelog/2.25.0/.release-notes.adoc.ftl b/src/changelog/2.25.0/.release-notes.adoc.ftl index 5780f2efe85..76b92252d79 100644 --- a/src/changelog/2.25.0/.release-notes.adoc.ftl +++ b/src/changelog/2.25.0/.release-notes.adoc.ftl @@ -30,6 +30,14 @@ https://www.graalvm.org/latest/reference-manual/native-image/metadata/[GraalVM r enabling seamless generation of native images with GraalVM out of the box—no manual configuration required. For more information, refer to our xref:graalvm.adoc[GraalVM guide]. +[NOTE] +==== +When building third-party Log4j plugins, using the new `GraalVmProcessor` +introduced in version `2.25.0` will automatically generate the required reachability metadata for GraalVM native images. +However, the processor will fail the build if the required `log4j.graalvm.groupId` and `log4j.graalvm.artifactId` parameters are not provided. +For detailed instructions, see xref:manual/plugins.adoc#plugin-registry[Registering plugins]. +==== + [#release-notes-2-25-0-PL-ex] === Exception Handling in Pattern Layout @@ -39,7 +47,7 @@ Key improvements include: * Stack traces are now consistently prefixed with a newline instead of other whitespace. * The default exception converter has changed from xref:manual/pattern-layout.adoc#converter-exception-extended[extended] to xref:manual/pattern-layout.adoc#converter-exception[plain], offering better performance. -* Support for the `{ansi}` option in exception converters has been removed. +* Support for the `\{ansi}` option in exception converters has been removed. [#release-notes-2-25-0-instant-format] === Date & Time Formatting @@ -51,7 +59,7 @@ These are now deprecated in favor of Java’s standard https://docs.oracle.com/javase/{java-target-version}/docs/api/java/time/format/DateTimeFormatter.html[`DateTimeFormatter`]. If you encounter formatting issues after upgrading—particularly with `n` or `x` directives—you can temporarily revert to the legacy formatters by setting the xref:manual/systemproperties.adoc#log4j2.instantFormatter[`log4j2.instantFormatter`] property to `legacy`. -Please report any issues via our {logging-services-url}/support.html#issues\[issue tracker]. +Please report any issues via our {logging-services-url}/support.html#issues[issue tracker]. [#release-notes-2-25-0-windows-ansi] === ANSI Support on Windows diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc index d032c53de30..2095597e39b 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc @@ -424,7 +424,7 @@ This example cannot be configured using Java properties. == JMS Appender The JMS Appender sends a formatted log event to a -https://jakarta.ee/specifications/messaging/3.0/[Jakarta] or https://jakarta.ee/specifications/messaging/2.0/[Javax] Messaging API +https://jakarta.ee/specifications/messaging/3.0/[Jakarta] or https://jakarta.ee/specifications/messaging/2.0/[Java] EE Messaging API destination. [IMPORTANT] @@ -434,9 +434,38 @@ xref:manual/systemproperties.adoc#log4j2.enableJndiJms[`log4j2.enableJndiJms`] configuration property to `true`. ==== -For Jakarta, use the `JMS-Jakarta` element name in the `log4j-jakarta-jms` Maven module. +[WARNING] +===== +Starting with Log4j `2.25.0`, the correct Appender element name depends on the version of Jakarta Messaging you are using: + +* **For Jakarta Messaging 3.0 or later**, use the `JMS-Jakarta` element name. +This requires additional runtime dependencies: ++ +[tabs] +==== +Maven:: ++ +[source,xml,subs="+attributes"] +---- + + org.apache.logging.log4j + log4j-jakarta-jms + {log4j-core-version} + +---- -For Javax, use the `JMS-Javax` element name; the names `JMS`, `JMSQueue`, and `JMSTopic` are provided for backward compatibility. +Gradle:: ++ +[source,groovy,subs="+attributes"] +---- +runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-jms:{log4j-core-version}' +---- +==== + +* **For Java Messaging or Jakarta Messaging 2.0**, use the `JMS-Javax` element name instead. + +The legacy element names `JMS`, `JMSQueue`, and `JMSTopic` are still supported for backward compatibility. +===== [#JmsAppender-attributes] .JMS Appender configuration attributes From ea10ad3e78469e43f138853b8c9892bc51bc87ec Mon Sep 17 00:00:00 2001 From: ASF Logging Services RM Date: Fri, 13 Jun 2025 17:38:30 +0000 Subject: [PATCH 04/31] Update the `project.build.outputTimestamp` property --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a336379dcb5..856d2a805e9 100644 --- a/pom.xml +++ b/pom.xml @@ -325,7 +325,7 @@ 2. This value is employed in various places while creating the distribution To mitigate these, we define a *dummy* value here and let the CI replace it during a release. Hence, *DO NOT MANUALLY EDIT THIS VALUE*! --> - 2024-12-10T10:15:05Z + 2025-06-13T17:08:55Z - 2.25.0 + 2.25.1-SNAPSHOT 2.25.0 2.25.0 From fd03a841a4b15f3fe584baa20390961561e2b752 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 20 Jun 2025 11:15:10 +0200 Subject: [PATCH 06/31] Remove `publish.profile` from production site (#3749) There is no `publish.profile` property in the `.asf.yaml` schema. Fixes #3598 --- .github/workflows/deploy-site.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-site.yaml b/.github/workflows/deploy-site.yaml index 9734ee4b3d5..e65aab28caa 100644 --- a/.github/workflows/deploy-site.yaml +++ b/.github/workflows/deploy-site.yaml @@ -61,7 +61,6 @@ jobs: with: asf-yaml-content: | publish: - profile: ~ whoami: ${{ github.ref_name }}-out subdir: content/log4j/2.x install-required: true From 517b18e2d1046e0fdb8564a382aee28e3bf00835 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 21 Jun 2025 04:53:32 +0200 Subject: [PATCH 07/31] fix: Update Javadoc output path to match plugin changes (#3757) The Javadoc site generation broke after upgrading to Maven Javadoc Plugin 3.10.0 due to a change in the output directory structure (see apache/maven-javadoc-plugin#1163). This update adjusts our build script to look in the new output location, restoring proper Javadoc generation. Closes #3753 > [!NOTE] > This change has already been applied to `2.x-site-pro` --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a7a62d36bd8..dac240d8414 100644 --- a/pom.xml +++ b/pom.xml @@ -830,7 +830,7 @@ ${maven.multiModuleProjectDirectory}/target/site/javadoc/${project.artifactId} - ${project.build.directory}/site/apidocs + ${project.build.directory}/reports/apidocs From 76661044a602d48eac716845513771f4b823a18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Sat, 21 Jun 2025 16:50:46 +0200 Subject: [PATCH 08/31] Pin `spotbugs-annotations` version to `4.8.6`, last release supporting Java 8 (#3762) --- .github/dependabot.yaml | 3 +++ log4j-parent/pom.xml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 6c73c48d8d7..5e7fa1e63ce 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -90,6 +90,9 @@ updates: registries: - maven-central ignore: + # `com.github.spotbugs:spotbugs-annotations:4.9.0` and onwards require Java 11 + - dependency-name: "com.github.spotbugs:spotbugs-annotations" + versions: [ "[4.9.0,)" ] # Jetty 10.x does not have an internal logging API - dependency-name: "org.eclipse.jetty:*" versions: [ "[10,)" ] diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index 33c3c9ac70a..c1e38a9231e 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -130,7 +130,8 @@ 1.1.2 4.14.0 3.6.0 - 4.9.3 + + 4.8.6 2.7.18 5.3.39 2.0.3 From 9773f6add30172a50bfa5b013fc1cf65d5ee1d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Mon, 23 Jun 2025 10:44:58 +0200 Subject: [PATCH 09/31] Move `jspecify.version` property and `java8-tests` profile from `log4j-bom` to `log4j-parent` (#3763) --- log4j-parent/pom.xml | 48 +++++++++++++++++++ pom.xml | 48 ------------------- .../.2.x.x/3758_fix_jspecify_dep.xml | 12 +++++ 3 files changed, 60 insertions(+), 48 deletions(-) create mode 100644 src/changelog/.2.x.x/3758_fix_jspecify_dep.xml diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index c1e38a9231e..6d8baeaff95 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -108,6 +108,7 @@ 0.6.0 3.6.1 1.37 + 1.0.0 4.13.2 5.13.1 1.9.1 @@ -1143,6 +1144,53 @@ + + + + java8-tests + + + + env.CI + true + + + + + + + org.jspecify + jspecify + ${jspecify.version} + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + default-test + + + [1.8, 9) + + + + + + + + + + diff --git a/pom.xml b/pom.xml index dac240d8414..10c52751dfa 100644 --- a/pom.xml +++ b/pom.xml @@ -357,7 +357,6 @@ - 1.0.0 0.9.0 21.7.1 10.5.0 @@ -956,53 +955,6 @@ - - - - java8-tests - - - - env.CI - true - - - - - - - org.jspecify - jspecify - ${jspecify.version} - test - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - default-test - - - [1.8, 9) - - - - - - - - - - rerun-tests diff --git a/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml b/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml new file mode 100644 index 00000000000..a4824608390 --- /dev/null +++ b/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml @@ -0,0 +1,12 @@ + + + + + Move `jspecify.version` Maven property and `java8-tests` profile from `log4j-bom` to `log4j-parent`, since the former gets trimmed before deployment. + + From 88744c6f0ae77aa73148c8ab47a82ca930ea8640 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:15:37 +0000 Subject: [PATCH 10/31] Bump org.apache.activemq:activemq-broker in /log4j-parent (#3777) Bumps [org.apache.activemq:activemq-broker](https://github.com/apache/activemq) from 6.1.6 to 6.1.7. - [Commits](https://github.com/apache/activemq/compare/activemq-6.1.6...activemq-6.1.7) --- updated-dependencies: - dependency-name: org.apache.activemq:activemq-broker dependency-version: 6.1.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- log4j-parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index 6d8baeaff95..f103d4daaa7 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -60,7 +60,7 @@ - 6.1.6 + 6.1.7 2.0.2 2.0.3 3.27.3 From a930253921fde3c84073e9a26048deb25103637f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 05:40:04 +0000 Subject: [PATCH 11/31] Update `org.eclipse.persistence:org.eclipse.persistence.jpa` to version `2.7.16` (#3769) Co-authored-by: ASF Logging Services RM --- log4j-parent/pom.xml | 2 +- ...rg_eclipse_persistence_org_eclipse_persistence_jpa.xml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index f103d4daaa7..c8aa805c8d9 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -123,7 +123,7 @@ 4.11.0 15.6 3.23.100 - 2.7.15 + 2.7.16 2.0.8 6.0.0 diff --git a/src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml b/src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml new file mode 100644 index 00000000000..eb8c8ba8d0d --- /dev/null +++ b/src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml @@ -0,0 +1,8 @@ + + + + Update `org.eclipse.persistence:org.eclipse.persistence.jpa` to version `2.7.16` + From a1e0b94249f683b41b8c331847b05e11f160fcba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 05:40:51 +0000 Subject: [PATCH 12/31] Update `org.xmlunit:xmlunit-core` to version `2.10.3` (#3767) Co-authored-by: ASF Logging Services RM --- log4j-parent/pom.xml | 2 +- src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index c8aa805c8d9..a0b8f4b0195 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -138,7 +138,7 @@ 2.0.3 1.7 2.35.2 - 2.10.2 + 2.10.3 1.10 1.5.7-3 diff --git a/src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml b/src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml new file mode 100644 index 00000000000..e00bd7e1546 --- /dev/null +++ b/src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml @@ -0,0 +1,8 @@ + + + + Update `org.xmlunit:xmlunit-core` to version `2.10.3` + From 1d5cb80939ec2c5d4e43783205ef61c8cfdd5b92 Mon Sep 17 00:00:00 2001 From: julianladisch Date: Sat, 28 Jun 2025 08:52:26 +0200 Subject: [PATCH 13/31] Fix `UuidPatternConverter` docs (#3768) --- .../core/pattern/UuidPatternConverter.java | 17 +++++++++++++---- .../ROOT/pages/manual/pattern-layout.adoc | 10 +++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/UuidPatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/UuidPatternConverter.java index bd93dcfbfad..c1a4aebd422 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/UuidPatternConverter.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/UuidPatternConverter.java @@ -22,7 +22,7 @@ import org.apache.logging.log4j.core.util.UuidUtil; /** - * Formats the event sequence number. + * Formats a UUID. */ @Plugin(name = "UuidPatternConverter", category = PatternConverter.CATEGORY) @ConverterKeys({"u", "uuid"}) @@ -39,10 +39,19 @@ private UuidPatternConverter(final boolean isRandom) { } /** - * Obtains an instance of SequencePatternConverter. + * Creates an instance of {@link UuidPatternConverter}. + *

+ * The {@code RANDOM} option generates a Type 4 (pseudo-randomly generated) UUID. + * The UUID is generated using a cryptographically strong pseudo-random number generator. + *

+ * The {@code TIME} option generates a Type 1 (date and time based) UUID using the local network interface's MAC address. + * To ensure uniqueness across multiple JVMs and/or class loaders on the same host, a random number between 0 and 16384 will be associated with each instance of the UUID generator class, and included in each time-based UUID generated. + * See {@link UuidUtil#UUID_SEQUENCE} how to seed the UUID generation with an integer value. + * Because time-based UUIDs contain the MAC address and timestamp, they should be used with care. * - * @param options options, currently ignored, may be null. - * @return instance of SequencePatternConverter. + * @param options An array containing either {@code RANDOM} or {@code TIME}. + * If empty, {@code TIME} will be used. + * @return a new {@link UuidPatternConverter} instance */ public static UuidPatternConverter newInstance(final String[] options) { if (options.length == 0) { diff --git a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc index d3f713e7942..b6b4aa788f1 100644 --- a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc @@ -1339,15 +1339,19 @@ Includes either a random or a time-based UUID .link:../javadoc/log4j-core/org/apache/logging/log4j/core/pattern/UuidPatternConverter.html[`UuidPatternConverter`] specifier grammar [source,text] ---- -u{RANDOM|TIME} -uuid{RANDOM|TIME} +u[{RANDOM|TIME}] +uuid[{RANDOM|TIME}] ---- -The time-based UUID is a Type 1 UUID generated using the MAC address of each host +The random UUID is a type 4 UUID. The UUID is generated using a cryptographically strong pseudo-random number generator. + +The time-based UUID is a Type 1 (date and time based) UUID generated using the MAC address of each host. To ensure uniqueness across multiple JVMs and/or class loaders on the same host, a random number between 0 and 16,384 will be associated with each instance of the UUID generator class, and included in each time-based UUID generated. See also xref:manual/systemproperties.adoc#log4j2.uuidSequence[`log4j2.uuidSequence`]. Because time-based UUIDs contain the MAC address and timestamp, they should be used with care. +TIME is the default. + [#format-modifiers] === Format modifiers From 754841e42ab74e71d3d0a09af3cee8e3b5a930d7 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 28 Jun 2025 09:11:35 +0200 Subject: [PATCH 14/31] fix: Define version of `error_prone_annotations` in parent POM (#3785) This change explicitly defines the version of the `error_prone_annotations` dependency in the `log4j` parent POM. Previously, the version was inherited via the `error-prone.version` property from `logging-parent`. However, because the `log4j-bom` POM is flattened during publication, this property no longer resolves in consumer projects. Fixes #3779 --- log4j-parent/pom.xml | 3 ++- src/changelog/.2.x.x/3758_fix_jspecify_dep.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index a0b8f4b0195..f4e56806a27 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -80,6 +80,7 @@ 1.2.15 3.4.4 0.9.0 + 2.38.0 7.0.5 4.0.27 33.4.8-jre @@ -1109,7 +1110,7 @@ com.google.errorprone error_prone_annotations - ${error-prone.version} + ${error-prone-annotations.version} org.osgi diff --git a/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml b/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml index a4824608390..78dba40899a 100644 --- a/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml +++ b/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml @@ -6,7 +6,8 @@ https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" type="fixed"> + - Move `jspecify.version` Maven property and `java8-tests` profile from `log4j-bom` to `log4j-parent`, since the former gets trimmed before deployment. + Fix version resolution of `jspecify` and `error_prone_annotations` dependencies in published POM files. From 600cfe2b83a0e0faa2a47767374fdb26986a061d Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 28 Jun 2025 09:14:25 +0200 Subject: [PATCH 15/31] fix: correctly detect Disruptor major version (#3778) ### fix(test): fail `DisruptorTest` on async thread exceptions Ensure that DisruptorTest explicitly fails when an exception occurs on an asynchronous thread. This improves error detection and prevents silent test passes in the presence of async failures. ### fix: correctly detect Disruptor major version Ensure the Disruptor version is detected using the classloader that loaded `DisruptorUtil`, rather than the thread-context classloader. The previous implementation relied on `LoaderUtil.isClassAvailable`, which may fail in environments where the Disruptor classes aren't visible to the thread-context classloader. --- .../log4j/core/async/DisruptorUtil.java | 15 ++- log4j-osgi-test/pom.xml | 2 + .../log4j/osgi/tests/DisruptorTest.java | 100 +++++++++++++++--- src/changelog/.2.x.x/3706_disruptor-tccl.xml | 12 +++ 4 files changed, 112 insertions(+), 17 deletions(-) create mode 100644 src/changelog/.2.x.x/3706_disruptor-tccl.xml diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java index bdd21bd4ef2..f115e2ae378 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java @@ -50,8 +50,19 @@ final class DisruptorUtil { static final boolean ASYNC_CONFIG_SYNCHRONIZE_ENQUEUE_WHEN_QUEUE_FULL = PropertiesUtil.getProperties() .getBooleanProperty("AsyncLoggerConfig.SynchronizeEnqueueWhenQueueFull", true); - static final int DISRUPTOR_MAJOR_VERSION = - LoaderUtil.isClassAvailable("com.lmax.disruptor.SequenceReportingEventHandler") ? 3 : 4; + static final int DISRUPTOR_MAJOR_VERSION = detectDisruptorMajorVersion(); + + // TODO: replace with LoaderUtil.isClassAvailable() when TCCL is removed + // See: https://github.com/apache/logging-log4j2/issues/3706 + private static int detectDisruptorMajorVersion() { + try { + Class.forName( + "com.lmax.disruptor.SequenceReportingEventHandler", true, DisruptorUtil.class.getClassLoader()); + return 3; + } catch (final ClassNotFoundException e) { + return 4; + } + } private DisruptorUtil() {} diff --git a/log4j-osgi-test/pom.xml b/log4j-osgi-test/pom.xml index b63666715e0..9517f3385c9 100644 --- a/log4j-osgi-test/pom.xml +++ b/log4j-osgi-test/pom.xml @@ -257,6 +257,7 @@ org.apache.logging.log4j.osgi.tests.DisruptorTest + org.apache.logging.log4j.osgi.tests.DisruptorTest$TestExceptionHandler org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector @@ -291,6 +292,7 @@ org.apache.logging.log4j.osgi.tests.DisruptorTest + org.apache.logging.log4j.osgi.tests.DisruptorTest$TestExceptionHandler org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector diff --git a/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/DisruptorTest.java b/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/DisruptorTest.java index 45ce5fef61c..813331210c5 100644 --- a/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/DisruptorTest.java +++ b/log4j-osgi-test/src/test/java/org/apache/logging/log4j/osgi/tests/DisruptorTest.java @@ -17,19 +17,26 @@ package org.apache.logging.log4j.osgi.tests; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.junitBundles; import static org.ops4j.pax.exam.CoreOptions.linkBundle; import static org.ops4j.pax.exam.CoreOptions.options; +import com.lmax.disruptor.ExceptionHandler; +import java.io.IOException; +import java.net.URL; +import java.util.concurrent.atomic.AtomicReference; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.async.AsyncLoggerContext; +import org.apache.logging.log4j.core.async.RingBufferLogEvent; import org.junit.Test; import org.junit.runner.RunWith; +import org.junitpioneer.jupiter.Issue; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; @@ -39,6 +46,8 @@ @ExamReactorStrategy(PerClass.class) public class DisruptorTest { + private static final int MESSAGE_COUNT = 128; + @org.ops4j.pax.exam.Configuration public Option[] config() { return options( @@ -59,21 +68,58 @@ public Option[] config() { } @Test - public void testDisruptorLog() { - // Logger context - LoggerContext context = getLoggerContext(); - assertTrue("LoggerContext is an instance of AsyncLoggerContext", context instanceof AsyncLoggerContext); - final CustomConfiguration custom = (CustomConfiguration) context.getConfiguration(); - // Logging - final Logger logger = LogManager.getLogger(getClass()); - logger.info("Hello OSGI from Log4j2!"); - - context.stop(); - assertEquals(1, custom.getEvents().size()); - final LogEvent event = custom.getEvents().get(0); - assertEquals("Hello OSGI from Log4j2!", event.getMessage().getFormattedMessage()); - assertEquals(Level.INFO, event.getLevel()); - custom.clearEvents(); + @Issue("https://github.com/apache/logging-log4j2/issues/3706") + public void testDisruptorLog() throws IOException { + ClassLoader threadContextClassLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader classLoader = createClassLoader(); + try { + // Set the context classloader to an empty classloader, so attempts to use the TCCL will not find any + // classes. + Thread.currentThread().setContextClassLoader(classLoader); + // Logger context + LoggerContext context = getLoggerContext(); + assertTrue("LoggerContext is an instance of AsyncLoggerContext", context instanceof AsyncLoggerContext); + final CustomConfiguration custom = (CustomConfiguration) context.getConfiguration(); + // Logging + final Logger logger = LogManager.getLogger(getClass()); + for (int i = 0; i < MESSAGE_COUNT; i++) { + logger.info("Hello OSGI from Log4j2! {}", i); + } + + context.stop(); + assertEquals(MESSAGE_COUNT, custom.getEvents().size()); + for (int i = 0; i < MESSAGE_COUNT; i++) { + final LogEvent event = custom.getEvents().get(i); + assertEquals( + "Message nr " + i, + "Hello OSGI from Log4j2! " + i, + event.getMessage().getFormattedMessage()); + assertEquals(Level.INFO, event.getLevel()); + } + custom.clearEvents(); + assertNull("Asynchronous exception", TestExceptionHandler.exception.get()); + } finally { + Thread.currentThread().setContextClassLoader(threadContextClassLoader); + } + } + + private static ClassLoader createClassLoader() { + // We want a classloader capable only of loading TestExceptionHandler. + // This is needed to detect exceptions thrown by the asynchronous thread. + return new ClassLoader() { + @Override + public Class loadClass(String name) throws ClassNotFoundException { + if (name.equals(TestExceptionHandler.class.getName())) { + return TestExceptionHandler.class; + } + throw new ClassNotFoundException(name); + } + + @Override + public URL getResource(String name) { + return null; // No resources available. + } + }; } private static LoggerContext getLoggerContext() { @@ -81,4 +127,28 @@ private static LoggerContext getLoggerContext() { assertEquals("AsyncDefault", ctx.getName()); return ctx; } + + public static class TestExceptionHandler implements ExceptionHandler { + + private static final AtomicReference exception = new AtomicReference<>(); + + @Override + public void handleEventException(Throwable ex, long sequence, RingBufferLogEvent event) { + setException(ex); + } + + @Override + public void handleOnStartException(Throwable ex) { + setException(ex); + } + + @Override + public void handleOnShutdownException(Throwable ex) { + setException(ex); + } + + private static void setException(Throwable ex) { + exception.compareAndSet(null, ex); + } + } } diff --git a/src/changelog/.2.x.x/3706_disruptor-tccl.xml b/src/changelog/.2.x.x/3706_disruptor-tccl.xml new file mode 100644 index 00000000000..a6a446fb14f --- /dev/null +++ b/src/changelog/.2.x.x/3706_disruptor-tccl.xml @@ -0,0 +1,12 @@ + + + + + Fix detection of the Disruptor major version in some environments. + + From d65da11ceb9d6cd572824b10e4b1d8b11632de14 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 28 Jun 2025 09:23:18 +0200 Subject: [PATCH 16/31] fix: Make `GraalVmProcessor` Arguments Optional (#3772) Fixes #3771 This PR makes the `-Alog4j.graalvm.groupId` and `-Alog4j.graalvm.artifactId` arguments optional. * If **no arguments** are provided, metadata is stored in: ``` META-INF/native-image/log4j-generated/ ``` Previously an error was thrown. * If **arguments are provided**, files go to: ``` META-INF/native-image/log4j-generated// ``` Previously `META-INF/native-image//` was used. The new path prevents collisions with user-provided metadata. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../processor/GraalVmProcessorTest.java | 188 ++++++++++++++---- .../java/FakeAnnotations.java | 83 ++++++++ .../GraalVmProcessorTest/java/FakePlugin.java | 90 +++++++++ .../plugins/processor/GraalVmProcessor.java | 58 ++++-- src/changelog/.2.x.x/3771_graalvm-params.xml | 10 + 5 files changed, 379 insertions(+), 50 deletions(-) create mode 100644 log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeAnnotations.java create mode 100644 log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakePlugin.java create mode 100644 src/changelog/.2.x.x/3771_graalvm-params.xml 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 9f8b51a7b75..9bdbcad8dd9 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 @@ -16,31 +16,56 @@ */ package org.apache.logging.log4j.core.config.plugins.processor; +import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; +import static java.util.Objects.requireNonNull; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.json; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.when; +import java.io.File; import java.io.IOException; import java.net.URL; -import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; import java.util.Map; +import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.io.IOUtils; +import javax.annotation.processing.Messager; +import javax.annotation.processing.ProcessingEnvironment; +import javax.lang.model.util.Elements; +import javax.tools.Diagnostic; +import javax.tools.DiagnosticCollector; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.StandardLocation; +import javax.tools.ToolProvider; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.CleanupMode; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mockito; class GraalVmProcessorTest { + private static final String FAKE_PLUGIN_NAME = "example.FakePlugin"; private static final Object FAKE_PLUGIN = asMap( "name", - FakePlugin.class.getName(), + FAKE_PLUGIN_NAME, "methods", asList( asMap("name", "", "parameterTypes", emptyList()), @@ -57,9 +82,10 @@ class GraalVmProcessorTest { "java.lang.String"))), "fields", emptyList()); + private static final String FAKE_PLUGIN_BUILDER_NAME = FAKE_PLUGIN_NAME + "$Builder"; private static final Object FAKE_PLUGIN_BUILDER = asMap( "name", - FakePlugin.Builder.class.getName(), + FAKE_PLUGIN_BUILDER_NAME, "methods", emptyList(), "fields", @@ -71,21 +97,27 @@ class GraalVmProcessorTest { asMap("name", "loggerContext"), asMap("name", "node"), asMap("name", "value"))); - private static final Object FAKE_PLUGIN_NESTED = onlyNoArgsConstructor(FakePlugin.Nested.class); - private static final Object FAKE_CONSTRAINT_VALIDATOR = - onlyNoArgsConstructor(FakeAnnotations.FakeConstraintValidator.class); - private static final Object FAKE_PLUGIN_VISITOR = onlyNoArgsConstructor(FakeAnnotations.FakePluginVisitor.class); + private static final String FAKE_PLUGIN_NESTED_NAME = FAKE_PLUGIN_NAME + "$Nested"; + private static final Object FAKE_PLUGIN_NESTED = onlyNoArgsConstructor(FAKE_PLUGIN_NESTED_NAME); + private static final String FAKE_CONSTRAINT_VALIDATOR_NAME = "example.FakeAnnotations$FakeConstraintValidator"; + private static final Object FAKE_CONSTRAINT_VALIDATOR = onlyNoArgsConstructor(FAKE_CONSTRAINT_VALIDATOR_NAME); + private static final String FAKE_PLUGIN_VISITOR_NAME = "example.FakeAnnotations$FakePluginVisitor"; + private static final Object FAKE_PLUGIN_VISITOR = onlyNoArgsConstructor(FAKE_PLUGIN_VISITOR_NAME); + + private static final String GROUP_ID = "groupId"; + private static final String ARTIFACT_ID = "artifactId"; + private static final String FALLBACK_METADATA_FOLDER = "fooBar"; /** * Generates a metadata element with just a single no-arg constructor. * - * @param clazz The name of the metadata element. + * @param className The name of the metadata element. * @return A GraalVM metadata element. */ - private static Object onlyNoArgsConstructor(Class clazz) { + private static Object onlyNoArgsConstructor(String className) { return asMap( "name", - clazz.getName(), + className, "methods", singletonList(asMap("name", "", "parameterTypes", emptyList())), "fields", @@ -103,43 +135,131 @@ private static Object onlyNoArgsConstructor(Class clazz) { return map; } - private static String reachabilityMetadata; + private static Path sourceDir; + + @TempDir + private static Path outputDir; @BeforeAll - static void setup() throws IOException { - // There are two descriptors, choose the one in `test-classes` - URL reachabilityMetadataUrl = null; - for (URL url : Collections.list(GraalVmProcessor.class - .getClassLoader() - .getResources("META-INF/native-image/org.apache.logging.log4j/log4j-core-test/reflect-config.json"))) { - if (url.getPath().contains("test-classes")) { - reachabilityMetadataUrl = url; - break; - } - } - assertThat(reachabilityMetadataUrl).isNotNull(); - reachabilityMetadata = IOUtils.toString(reachabilityMetadataUrl, StandardCharsets.UTF_8); + static void setup() throws Exception { + URL sourceUrl = requireNonNull(GraalVmProcessorTest.class.getResource("/GraalVmProcessorTest/java")); + sourceDir = Paths.get(sourceUrl.toURI()); + // Generate metadata + List diagnostics = generateDescriptor(sourceDir, GROUP_ID, ARTIFACT_ID, outputDir); + assertThat(diagnostics).isEmpty(); } static Stream containsSpecificEntries() { return Stream.of( - Arguments.of(FakePlugin.class, FAKE_PLUGIN), - Arguments.of(FakePlugin.Builder.class, FAKE_PLUGIN_BUILDER), - Arguments.of(FakePlugin.Nested.class, FAKE_PLUGIN_NESTED), - Arguments.of(FakeAnnotations.FakeConstraintValidator.class, FAKE_CONSTRAINT_VALIDATOR), - Arguments.of(FakeAnnotations.FakePluginVisitor.class, FAKE_PLUGIN_VISITOR)); + Arguments.of(FAKE_PLUGIN_NAME, FAKE_PLUGIN), + Arguments.of(FAKE_PLUGIN_BUILDER_NAME, FAKE_PLUGIN_BUILDER), + Arguments.of(FAKE_PLUGIN_NESTED_NAME, FAKE_PLUGIN_NESTED), + Arguments.of(FAKE_CONSTRAINT_VALIDATOR_NAME, FAKE_CONSTRAINT_VALIDATOR), + Arguments.of(FAKE_PLUGIN_VISITOR_NAME, FAKE_PLUGIN_VISITOR)); } @ParameterizedTest @MethodSource - void containsSpecificEntries(Class clazz, Object expectedJson) { + void containsSpecificEntries(String className, Object expectedJson) throws IOException { + // Read metadata + Path reachabilityMetadataPath = + outputDir.resolve("META-INF/native-image/log4j-generated/groupId/artifactId/reflect-config.json"); + String reachabilityMetadata = new String(Files.readAllBytes(reachabilityMetadataPath), UTF_8); assertThatJson(reachabilityMetadata) - .inPath(filterByName(clazz)) + .inPath(String.format("$[?(@.name == '%s')]", className)) .isArray() .contains(json(expectedJson)); } - private String filterByName(Class clazz) { - return String.format("$[?(@.name == '%s')]", clazz.getName()); + static Stream reachabilityMetadataPath() { + return Stream.of( + Arguments.of( + "groupId", + "artifactId", + "META-INF/native-image/log4j-generated/groupId/artifactId/reflect-config.json"), + Arguments.of(null, "artifactId", "META-INF/native-image/log4j-generated/fooBar/reflect-config.json"), + Arguments.of("groupId", null, "META-INF/native-image/log4j-generated/fooBar/reflect-config.json"), + Arguments.of(null, null, "META-INF/native-image/log4j-generated/fooBar/reflect-config.json")); + } + + @ParameterizedTest + @MethodSource + void reachabilityMetadataPath(@Nullable String groupId, @Nullable String artifactId, String expected) { + Messager messager = Mockito.mock(Messager.class); + Elements elements = Mockito.mock(Elements.class); + ProcessingEnvironment processingEnv = Mockito.mock(ProcessingEnvironment.class); + when(processingEnv.getMessager()).thenReturn(messager); + when(processingEnv.getElementUtils()).thenReturn(elements); + GraalVmProcessor processor = new GraalVmProcessor(); + processor.init(processingEnv); + assertThat(processor.getReachabilityMetadataPath(groupId, artifactId, FALLBACK_METADATA_FOLDER)) + .isEqualTo(expected); + } + + @Test + void whenNoGroupIdAndArtifactId_thenWarningIsPrinted(@TempDir(cleanup = CleanupMode.NEVER) Path outputDir) + throws Exception { + List diagnostics = generateDescriptor(sourceDir, null, null, outputDir); + assertThat(diagnostics).hasSize(1); + // The warning message should contain the information about the missing groupId and artifactId arguments + assertThat(diagnostics.get(0)) + .contains( + "recommended", + "-A" + GraalVmProcessor.GROUP_ID + "=", + "-A" + GraalVmProcessor.ARTIFACT_ID + "="); + Path path = outputDir.resolve("META-INF/native-image/log4j-generated"); + List reachabilityMetadataFolders; + try (Stream files = Files.list(path)) { + reachabilityMetadataFolders = files.filter(Files::isDirectory).collect(Collectors.toList()); + } + // The generated folder name should be deterministic and based solely on the descriptor content. + // If the descriptor changes, this test and the expected folder name must be updated accordingly. + assertThat(reachabilityMetadataFolders).hasSize(1).containsExactly(path.resolve("62162090")); + assertThat(reachabilityMetadataFolders.get(0).resolve("reflect-config.json")) + .as("Reachability metadata file") + .exists(); + } + + private static List generateDescriptor( + Path sourceDir, @Nullable String groupId, @Nullable String artifactId, Path outputDir) throws Exception { + // Instantiate the tooling + final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + final StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, Locale.ROOT, UTF_8); + + // Populate sources + final Iterable sources; + try (final Stream files = Files.walk(sourceDir)) { + File[] sourceFiles = + files.filter(Files::isRegularFile).map(Path::toFile).toArray(File[]::new); + sources = fileManager.getJavaFileObjects(sourceFiles); + } + + // Set the target path used by `DescriptorGenerator` to dump the generated files + fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(outputDir.toFile())); + + // Prepare the compiler options + List options = new ArrayList<>(); + options.add("-proc:only"); + options.add("-processor"); + options.add(GraalVmProcessor.class.getName()); + if (groupId != null) { + options.add("-A" + GraalVmProcessor.GROUP_ID + "=" + groupId); + } + if (artifactId != null) { + options.add("-A" + GraalVmProcessor.ARTIFACT_ID + "=" + artifactId); + } + + // Compile the sources + final Path descriptorFilePath = outputDir.resolve("plugins.xml"); + final DiagnosticCollector diagnosticCollector = new DiagnosticCollector<>(); + final JavaCompiler.CompilationTask task = + compiler.getTask(null, fileManager, diagnosticCollector, options, null, sources); + task.call(); + + // Verify successful compilation + return diagnosticCollector.getDiagnostics().stream() + .filter(d -> d.getKind() != Diagnostic.Kind.NOTE) + .map(d -> d.getMessage(Locale.ROOT)) + .collect(Collectors.toList()); } } diff --git a/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeAnnotations.java b/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeAnnotations.java new file mode 100644 index 00000000000..c3223781f49 --- /dev/null +++ b/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeAnnotations.java @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package example; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Member; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.Node; +import org.apache.logging.log4j.core.config.plugins.PluginVisitorStrategy; +import org.apache.logging.log4j.core.config.plugins.validation.Constraint; +import org.apache.logging.log4j.core.config.plugins.validation.ConstraintValidator; +import org.apache.logging.log4j.core.config.plugins.visitors.PluginVisitor; +import org.apache.logging.log4j.core.lookup.StrSubstitutor; + +/** + * Fake constraint and plugin visitor that are accessed through reflection. + */ +public class FakeAnnotations { + + @Constraint(FakeConstraintValidator.class) + public @interface FakeConstraint {} + + public static class FakeConstraintValidator implements ConstraintValidator { + @Override + public void initialize(FakeConstraint annotation) {} + + @Override + public boolean isValid(String name, Object value) { + return false; + } + } + + @PluginVisitorStrategy(FakePluginVisitor.class) + public @interface FakeAnnotation {} + + public static class FakePluginVisitor implements PluginVisitor { + + @Override + public PluginVisitor setAnnotation(Annotation annotation) { + return null; + } + + @Override + public PluginVisitor setAliases(String... aliases) { + return null; + } + + @Override + public PluginVisitor setStrSubstitutor(StrSubstitutor substitutor) { + return null; + } + + @Override + public PluginVisitor setMember(Member member) { + return null; + } + + @Override + public Object visit(Configuration configuration, Node node, LogEvent event, StringBuilder log) { + return null; + } + + @Override + public PluginVisitor setConversionType(Class conversionType) { + return null; + } + } +} diff --git a/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakePlugin.java b/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakePlugin.java new file mode 100644 index 00000000000..90b872c0a31 --- /dev/null +++ b/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakePlugin.java @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package example; + +import java.io.Serializable; +import org.apache.logging.log4j.core.Layout; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.Node; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginAliases; +import org.apache.logging.log4j.core.config.plugins.PluginAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; +import org.apache.logging.log4j.core.config.plugins.PluginElement; +import org.apache.logging.log4j.core.config.plugins.PluginFactory; +import org.apache.logging.log4j.core.config.plugins.PluginLoggerContext; +import org.apache.logging.log4j.core.config.plugins.PluginNode; +import org.apache.logging.log4j.core.config.plugins.PluginValue; + +/** + * Test plugin class for unit tests. + */ +@Plugin(name = "Fake", category = "Test") +@PluginAliases({"AnotherFake", "StillFake"}) +public class FakePlugin { + + @Plugin(name = "Nested", category = "Test") + public static class Nested {} + + @PluginFactory + public static FakePlugin newPlugin( + @PluginAttribute("attribute") int attribute, + @PluginElement("layout") Layout layout, + @PluginConfiguration Configuration config, + @PluginNode Node node, + @PluginLoggerContext LoggerContext loggerContext, + @PluginValue("value") String value) { + return null; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static class Builder implements org.apache.logging.log4j.core.util.Builder { + + @PluginBuilderAttribute + @SuppressWarnings("log4j.public.setter") + private int attribute; + + @PluginBuilderAttribute + @SuppressWarnings("log4j.public.setter") + private int attributeWithoutPublicSetterButWithSuppressAnnotation; + + @PluginElement("layout") + private Layout layout; + + @PluginConfiguration + private Configuration config; + + @PluginNode + private Node node; + + @PluginLoggerContext + private LoggerContext loggerContext; + + @PluginValue("value") + private String value; + + @Override + public FakePlugin build() { + return null; + } + } +} 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 3b1f9bd5cb6..e6178f2a17e 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 @@ -18,9 +18,11 @@ import aQute.bnd.annotation.Resolution; import aQute.bnd.annotation.spi.ServiceProvider; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -75,8 +77,10 @@ @SupportedOptions({"log4j.graalvm.groupId", "log4j.graalvm.artifactId"}) public class GraalVmProcessor extends AbstractProcessor { - private static final String GROUP_ID = "log4j.graalvm.groupId"; - private static final String ARTIFACT_ID = "log4j.graalvm.artifactId"; + static final String GROUP_ID = "log4j.graalvm.groupId"; + static final String ARTIFACT_ID = "log4j.graalvm.artifactId"; + private static final String LOCATION_PREFIX = "META-INF/native-image/log4j-generated/"; + private static final String LOCATION_SUFFIX = "/reflect-config.json"; private static final String PROCESSOR_NAME = GraalVmProcessor.class.getSimpleName(); private final Map reachableTypes = new HashMap<>(); @@ -184,11 +188,21 @@ private void processFactory(Element element) { } private void writeReachabilityMetadata() { - // - // Many users will have `log4j-core` on the annotation processor path, but do not have Log4j Plugins. - // Therefore, we check for the annotation processor required options only if some elements were processed. - // - String reachabilityMetadataPath = getReachabilityMetadataPath(); + // Compute the reachability metadata + ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); + try { + ReachabilityMetadata.writeReflectConfig(reachableTypes.values(), arrayOutputStream); + } catch (IOException e) { + String message = String.format( + "%s: an error occurred while generating reachability metadata: %s", PROCESSOR_NAME, e.getMessage()); + processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message); + return; + } + byte[] data = arrayOutputStream.toByteArray(); + + Map options = processingEnv.getOptions(); + String reachabilityMetadataPath = getReachabilityMetadataPath( + options.get(GROUP_ID), options.get(ARTIFACT_ID), Integer.toHexString(Arrays.hashCode(data))); Messager messager = processingEnv.getMessager(); messager.printMessage( Diagnostic.Kind.NOTE, @@ -203,7 +217,7 @@ private void writeReachabilityMetadata() { reachabilityMetadataPath, processedElements.toArray(new Element[0])) .openOutputStream()) { - ReachabilityMetadata.writeReflectConfig(reachableTypes.values(), output); + output.write(data); } catch (IOException e) { String message = String.format( "%s: unable to write reachability metadata to file `%s`", PROCESSOR_NAME, reachabilityMetadataPath); @@ -212,18 +226,30 @@ private void writeReachabilityMetadata() { } } - private String getReachabilityMetadataPath() { - String groupId = processingEnv.getOptions().get(GROUP_ID); - String artifactId = processingEnv.getOptions().get(ARTIFACT_ID); + /** + * Returns the path to the reachability metadata file. + *

+ * If the groupId or artifactId is not specified, a warning is printed and a fallback folder name is used. + * The fallback folder name should be reproducible, but unique enough to avoid conflicts. + *

+ * + * @param groupId The group ID of the plugin. + * @param artifactId The artifact ID of the plugin. + * @param fallbackFolderName The fallback folder name to use if groupId or artifactId is not specified. + */ + String getReachabilityMetadataPath( + @Nullable String groupId, @Nullable String artifactId, String fallbackFolderName) { if (groupId == null || artifactId == null) { String message = String.format( - "The `%s` annotation processor is missing the required `%s` and `%s` options.%n" - + "The generation of GraalVM reflection metadata for your Log4j Plugins will be disabled.", + "The `%1$s` annotation processor is missing the recommended `%2$s` and `%3$s` options.%n" + + "To follow the GraalVM recommendations, please add the following options to your build tool:%n" + + " -A%2$s=%n" + + " -A%3$s=%n", PROCESSOR_NAME, GROUP_ID, ARTIFACT_ID); - processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message); - throw new IllegalArgumentException(message); + processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, message); + return LOCATION_PREFIX + fallbackFolderName + LOCATION_SUFFIX; } - return String.format("META-INF/native-image/%s/%s/reflect-config.json", groupId, artifactId); + return LOCATION_PREFIX + groupId + '/' + artifactId + LOCATION_SUFFIX; } private void addField(TypeElement parent, VariableElement element) { diff --git a/src/changelog/.2.x.x/3771_graalvm-params.xml b/src/changelog/.2.x.x/3771_graalvm-params.xml new file mode 100644 index 00000000000..ff3c79b1efa --- /dev/null +++ b/src/changelog/.2.x.x/3771_graalvm-params.xml @@ -0,0 +1,10 @@ + + + + + Make `-Alog4j.graalvm.groupId` and `-Alog4j.graalvm.artifactId` arguments optional. + + From 3dd797c5a702121d8d1430b386f5beb823383345 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 28 Jun 2025 09:26:43 +0200 Subject: [PATCH 17/31] fix: Restore Backward Compatibility with Spring Boot Reconfiguration (#3773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### feat: add tests for `LoggerContext.start` behavior Add test verifying expected behavior of `LoggerContext.start(Configuration)` to ensure backward compatibility: - The configuration must always be replaced, even if the context has already started. - Only the first configuration should register the shutdown hook. ### fix: Restore Backward Compatibility with Spring Boot Reconfiguration Although Spring Boot never directly starts a `LoggerContext`, its logging system — including our `Log4j2SpringBootLoggingSystem` and equivalents in Spring Boot 2.x and 3.x — has consistently used `LoggerContext.start(Configuration)` for reconfiguration. This use case was not taken into consideration in #2614, causing a regression for Spring Boot users. To maintain backward compatibility with these usages, `start(Configuration)` now falls back to `reconfigure(Configuration)` if the context is already started. Closes #3770 --- .../logging/log4j/core/LoggerContextTest.java | 26 +++++++ .../log4j/core/ShutdownDisabledTest.java | 77 ++++++++++++++++--- .../logging/log4j/core/LoggerContext.java | 30 ++++++-- .../.2.x.x/3770_LoggerContext_start.xml | 12 +++ 4 files changed, 131 insertions(+), 14 deletions(-) create mode 100644 src/changelog/.2.x.x/3770_LoggerContext_start.xml diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/LoggerContextTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/LoggerContextTest.java index e14bc11a2eb..e6d58f66c79 100644 --- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/LoggerContextTest.java +++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/LoggerContextTest.java @@ -17,7 +17,9 @@ package org.apache.logging.log4j.core; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.CALLS_REAL_METHODS; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.withSettings; import java.util.Collection; import java.util.concurrent.ExecutorService; @@ -25,11 +27,16 @@ import java.util.concurrent.Future; import java.util.stream.Collectors; import java.util.stream.IntStream; +import org.apache.logging.log4j.core.config.AbstractConfiguration; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.ConfigurationSource; +import org.apache.logging.log4j.core.config.DefaultConfiguration; import org.apache.logging.log4j.message.MessageFactory; import org.apache.logging.log4j.message.MessageFactory2; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; +import org.junitpioneer.jupiter.Issue; class LoggerContextTest { @@ -75,4 +82,23 @@ void getLoggers_can_be_updated_concurrently(final TestInfo testInfo) { executorService.shutdown(); } } + + @Test + @Issue("https://github.com/apache/logging-log4j2/issues/3770") + void start_should_fallback_on_reconfigure_if_context_already_started(final TestInfo testInfo) { + final String testName = testInfo.getDisplayName(); + try (final LoggerContext loggerContext = new LoggerContext(testName)) { + loggerContext.start(); + assertThat(loggerContext.isStarted()).isTrue(); + assertThat(loggerContext.getConfiguration()).isInstanceOf(DefaultConfiguration.class); + // Start + Configuration configuration = mock( + AbstractConfiguration.class, + withSettings() + .useConstructor(null, ConfigurationSource.NULL_SOURCE) + .defaultAnswer(CALLS_REAL_METHODS)); + loggerContext.start(configuration); + assertThat(loggerContext.getConfiguration()).isSameAs(configuration); + } + } } diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java index 2e576d226b8..4bfa9f5d6ad 100644 --- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java +++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java @@ -16,25 +16,84 @@ */ package org.apache.logging.log4j.core; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; +import static org.apache.logging.log4j.core.util.ReflectionUtil.getFieldValue; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.CALLS_REAL_METHODS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; import java.lang.reflect.Field; +import org.apache.logging.log4j.core.config.AbstractConfiguration; import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.ConfigurationSource; import org.apache.logging.log4j.core.test.junit.LoggerContextSource; -import org.apache.logging.log4j.core.util.ReflectionUtil; import org.apache.logging.log4j.test.junit.SetTestProperty; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; @SetTestProperty(key = "log4j2.isWebapp", value = "false") -@LoggerContextSource("log4j-test3.xml") class ShutdownDisabledTest { + private static final Field shutdownCallbackField; + + static { + try { + shutdownCallbackField = LoggerContext.class.getDeclaredField("shutdownCallback"); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } + } + + @Test + @LoggerContextSource("log4j-test3.xml") + void testShutdownFlag(final Configuration config, final LoggerContext ctx) { + assertThat(config.isShutdownHookEnabled()) + .as("Shutdown hook is enabled") + .isFalse(); + assertThat(getFieldValue(shutdownCallbackField, ctx)) + .as("Shutdown callback") + .isNull(); + } + @Test - void testShutdownFlag(final Configuration config, final LoggerContext ctx) throws NoSuchFieldException { - Field shutdownCallback = LoggerContext.class.getDeclaredField("shutdownCallback"); - Object fieldValue = ReflectionUtil.getFieldValue(shutdownCallback, ctx); - assertFalse(config.isShutdownHookEnabled(), "Shutdown hook is enabled"); - assertNull(fieldValue, "Shutdown callback"); + void whenLoggerContextInitialized_respectsShutdownDisabled(TestInfo testInfo) { + Configuration configuration = mockConfiguration(); + when(configuration.isShutdownHookEnabled()).thenReturn(false); + try (final LoggerContext ctx = new LoggerContext(testInfo.getDisplayName())) { + ctx.start(configuration); + assertThat(ctx.isStarted()).isTrue(); + assertThat(ctx.getConfiguration()).isSameAs(configuration); + assertThat(getFieldValue(shutdownCallbackField, ctx)) + .as("Shutdown callback") + .isNull(); + } + } + + @Test + void whenLoggerContextStarted_ignoresShutdownDisabled(TestInfo testInfo) { + // Traditional behavior: during reconfiguration, the shutdown hook is not removed. + Configuration initialConfiguration = mockConfiguration(); + when(initialConfiguration.isShutdownHookEnabled()).thenReturn(true); + Configuration configuration = mockConfiguration(); + when(configuration.isShutdownHookEnabled()).thenReturn(false); + try (final LoggerContext ctx = new LoggerContext(testInfo.getDisplayName())) { + ctx.start(initialConfiguration); + assertThat(ctx.isStarted()).isTrue(); + Object shutdownCallback = getFieldValue(shutdownCallbackField, ctx); + assertThat(shutdownCallback).as("Shutdown callback").isNotNull(); + ctx.start(configuration); + assertThat(getFieldValue(shutdownCallbackField, ctx)) + .as("Shutdown callback") + .isSameAs(shutdownCallback); + } + } + + private static Configuration mockConfiguration() { + return mock( + AbstractConfiguration.class, + withSettings() + .useConstructor(null, ConfigurationSource.NULL_SOURCE) + .defaultAnswer(CALLS_REAL_METHODS)); } } diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java index bf2f77383c0..6db471cb87a 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java @@ -286,6 +286,16 @@ public static LoggerContext getContext( return (LoggerContext) LogManager.getContext(loader, currentContext, configLocation); } + /** + * Starts the context using the configuration specified by {@link #getConfigLocation()}. + *

+ * If the configuration location is {@code null}, Log4j will search for a configuration file + * using the default classpath resources. For details on the search order and supported formats, + * see the + * + * Log4j 2 Configuration File Location documentation. + *

+ */ @Override public void start() { LOGGER.debug("Starting LoggerContext[name={}, {}]...", getName(), this); @@ -312,21 +322,31 @@ public void start() { } /** - * Starts with a specific configuration. - * - * @param config The new Configuration. + * Starts the context using a specific configuration. + *

+ * Warning: For backward compatibility, especially with Spring Boot, + * if the context is already started, this method will fall back to {@link #reconfigure(Configuration)}. + * This behavior is maintained for legacy integrations and may change in future major versions. + * New code should not rely on this fallback. + *

+ * @param config The new {@link Configuration} to use for this context */ public void start(final Configuration config) { LOGGER.info("Starting {}[name={}] with configuration {}...", getClass().getSimpleName(), getName(), config); if (configLock.tryLock()) { try { - if (this.isInitialized() || this.isStopped()) { + if (isInitialized() || isStopped()) { setStarting(); reconfigure(config); if (this.configuration.isShutdownHookEnabled()) { setUpShutdownHook(); } - this.setStarted(); + setStarted(); + } else { + // Required for Spring Boot integration: + // Both `Log4jSpringBootLoggingSystem` and its Spring Boot 3.x equivalent + // invoke `start()` even during context reconfiguration. + reconfigure(config); } } finally { configLock.unlock(); diff --git a/src/changelog/.2.x.x/3770_LoggerContext_start.xml b/src/changelog/.2.x.x/3770_LoggerContext_start.xml new file mode 100644 index 00000000000..84416d9c546 --- /dev/null +++ b/src/changelog/.2.x.x/3770_LoggerContext_start.xml @@ -0,0 +1,12 @@ + + + + + Restore backward compatibility with the Spring Boot reconfiguration process. + + From 8fcbcdec82d572cf0039bca38a3c1ed0d67fba91 Mon Sep 17 00:00:00 2001 From: Johan Compagner Date: Mon, 30 Jun 2025 18:57:18 +0200 Subject: [PATCH 18/31] introduced a jakarta support range for the bnd tool (#3791) Fixes #3787 --- log4j-jakarta-web/pom.xml | 3 +++ ...rta-web_relax_the_import_package_constraints.xml | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml diff --git a/log4j-jakarta-web/pom.xml b/log4j-jakarta-web/pom.xml index 9dc66676119..4c5f33a4db8 100644 --- a/log4j-jakarta-web/pom.xml +++ b/log4j-jakarta-web/pom.xml @@ -39,6 +39,9 @@ --> org.apache.logging.log4j.web org.apache.logging.log4j.core + [5.0,7) + jakarta.servlet;version="${jakarta.support.range}", + jakarta.servlet.http;version="${jakarta.support.range}"
diff --git a/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml b/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml new file mode 100644 index 00000000000..9602fb8af87 --- /dev/null +++ b/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml @@ -0,0 +1,13 @@ + + + + + add a bnd tool property that makes sure that the supported jakarta version has a wider range then 5 to 6 + Support the current release version for 5 to 7 + + From 36ab06eff500faaa6fc90bd736efde58b34e9836 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 3 Jul 2025 16:02:29 +0200 Subject: [PATCH 19/31] doc: Clarify and enhance `GraalVmProcessor` configuration example (#3786) This update refines the `GraalVmProcessor` configuration example in response to feedback from #3755. The goal is to make the example more reliable and aligned with common Maven project setups. Key improvements include: * **Ensuring consistent parameter usage:** The example now adds `-Alog4j.graalvm.groupId` and `-Alog4j.graalvm.artifactId` to **all executions** of the Maven Compiler Plugin. This guarantees correct behavior regardless of the execution ID used in user projects. * **Simplifying plugin execution setup:** Instead of introducing a dedicated `generate-log4j-plugin-descriptor` execution, the example now modifies the existing `default-compile` execution. This reflects the most typical use case, where annotation processing and compilation occur together. These changes aim to make the setup easier to adopt while reducing configuration errors. --- .../modules/ROOT/pages/manual/plugins.adoc | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/site/antora/modules/ROOT/pages/manual/plugins.adoc b/src/site/antora/modules/ROOT/pages/manual/plugins.adoc index 233b6fd3226..6b751f07366 100644 --- a/src/site/antora/modules/ROOT/pages/manual/plugins.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/plugins.adoc @@ -211,8 +211,8 @@ annotation processor creates such a file at compile-time. [WARNING] ==== -The `GraalVmProcessor` needs to know the `groupId` and `artifactId` coordinates of your project. -These must be supplied to the processor using the `log4j.graalvm.groupId` and `log4j.graalvm.artifactId` annotation processor options. +The `GraalVmProcessor` requires your project's `groupId` and `artifactId` to correctly generate the GraalVM reachability metadata file in the recommended location. +Provide these values to the processor using the `log4j.graalvm.groupId` and `log4j.graalvm.artifactId` annotation processor options. ==== You need to configure your build tool as follows to use both plugin processors: @@ -227,15 +227,23 @@ Maven:: org.apache.maven.plugins maven-compiler-plugin ${maven-compiler-plugin.version} + + + + -Alog4j.graalvm.groupId=${project.groupId} + -Alog4j.graalvm.artifactId=${project.artifactId} + + - generate-log4j-plugin-descriptor - - compile - - process-classes + + default-compile - only org.apache.logging.log4j.core.config.plugins.processor.GraalVmProcessor - - - -Alog4j.graalvm.groupId=${project.groupId} - -Alog4j.graalvm.artifactId=${project.artifactId} - From 65036cb2f27b73439491e3c2fbaa628396146b04 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 3 Jul 2025 16:55:32 +0200 Subject: [PATCH 20/31] fix: Fix Java type for annotated array parameters (#3797) This update fixes the GraalVM reachability metadata generation for methods with annotated array parameters, such as `@Nullable String[]`. Previously, the code computed the fully qualified class name for the parameter using the **raw** type, which retained the annotations (e.g., `@org.jspecify.annotations.Nullable java.lang.String`). This resulted in incorrect metadata that was ignored by GraalVM. The issue is resolved by transforming the `DeclaredType` into a `TypeElement`, effectively removing any annotations, and then calling `getQualifiedName()` to correctly generate the fully qualified class name without annotations. --- .../processor/GraalVmProcessorTest.java | 24 ++++++++-- .../java/FakeConverter.java | 46 +++++++++++++++++++ .../plugins/processor/GraalVmProcessor.java | 4 +- .../3796_annotated-array-parameters.xml | 12 +++++ 4 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeConverter.java create mode 100644 src/changelog/.2.x.x/3796_annotated-array-parameters.xml 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 9bdbcad8dd9..957bb3228cd 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 @@ -103,6 +103,18 @@ class GraalVmProcessorTest { private static final Object FAKE_CONSTRAINT_VALIDATOR = onlyNoArgsConstructor(FAKE_CONSTRAINT_VALIDATOR_NAME); private static final String FAKE_PLUGIN_VISITOR_NAME = "example.FakeAnnotations$FakePluginVisitor"; private static final Object FAKE_PLUGIN_VISITOR = onlyNoArgsConstructor(FAKE_PLUGIN_VISITOR_NAME); + private static final String FAKE_CONVERTER_NAME = "example.FakeConverter"; + private static final Object FAKE_CONVERTER = asMap( + "name", + FAKE_CONVERTER_NAME, + "methods", + singletonList(asMap( + "name", + "newInstance", + "parameterTypes", + asList("org.apache.logging.log4j.core.config.Configuration", "java.lang.String[]"))), + "fields", + emptyList()); private static final String GROUP_ID = "groupId"; private static final String ARTIFACT_ID = "artifactId"; @@ -155,7 +167,8 @@ static Stream containsSpecificEntries() { Arguments.of(FAKE_PLUGIN_BUILDER_NAME, FAKE_PLUGIN_BUILDER), Arguments.of(FAKE_PLUGIN_NESTED_NAME, FAKE_PLUGIN_NESTED), Arguments.of(FAKE_CONSTRAINT_VALIDATOR_NAME, FAKE_CONSTRAINT_VALIDATOR), - Arguments.of(FAKE_PLUGIN_VISITOR_NAME, FAKE_PLUGIN_VISITOR)); + Arguments.of(FAKE_PLUGIN_VISITOR_NAME, FAKE_PLUGIN_VISITOR), + Arguments.of(FAKE_CONVERTER_NAME, FAKE_CONVERTER)); } @ParameterizedTest @@ -168,7 +181,9 @@ void containsSpecificEntries(String className, Object expectedJson) throws IOExc assertThatJson(reachabilityMetadata) .inPath(String.format("$[?(@.name == '%s')]", className)) .isArray() - .contains(json(expectedJson)); + .hasSize(1) + .first() + .isEqualTo(json(expectedJson)); } static Stream reachabilityMetadataPath() { @@ -214,7 +229,7 @@ void whenNoGroupIdAndArtifactId_thenWarningIsPrinted(@TempDir(cleanup = CleanupM } // The generated folder name should be deterministic and based solely on the descriptor content. // If the descriptor changes, this test and the expected folder name must be updated accordingly. - assertThat(reachabilityMetadataFolders).hasSize(1).containsExactly(path.resolve("62162090")); + assertThat(reachabilityMetadataFolders).hasSize(1).containsExactly(path.resolve("72c240aa")); assertThat(reachabilityMetadataFolders.get(0).resolve("reflect-config.json")) .as("Reachability metadata file") .exists(); @@ -250,7 +265,6 @@ private static List generateDescriptor( } // Compile the sources - final Path descriptorFilePath = outputDir.resolve("plugins.xml"); final DiagnosticCollector diagnosticCollector = new DiagnosticCollector<>(); final JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, diagnosticCollector, options, null, sources); @@ -260,6 +274,8 @@ private static List generateDescriptor( return diagnosticCollector.getDiagnostics().stream() .filter(d -> d.getKind() != Diagnostic.Kind.NOTE) .map(d -> d.getMessage(Locale.ROOT)) + // This message appears when the test runs on JDK 8 + .filter(m -> !"unknown enum constant java.lang.annotation.ElementType.MODULE".equals(m)) .collect(Collectors.toList()); } } diff --git a/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeConverter.java b/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeConverter.java new file mode 100644 index 00000000000..0b15cb4ecc1 --- /dev/null +++ b/log4j-core-test/src/test/resources/GraalVmProcessorTest/java/FakeConverter.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package example; + +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.pattern.ConverterKeys; +import org.apache.logging.log4j.core.pattern.LogEventPatternConverter; +import org.apache.logging.log4j.core.pattern.PatternConverter; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +@Plugin(name = "FakePatternConverter", category = PatternConverter.CATEGORY) +@ConverterKeys({"f", "fake"}) +public final class FakeConverter extends LogEventPatternConverter { + + private FakeConverter(@Nullable final Configuration config, @Nullable final String[] options) { + super("Fake", "fake"); + } + + public static FakeConverter newInstance( + @Nullable final Configuration config, @Nullable final String[] options) { + return new FakeConverter(config, options); + } + + @Override + public void format(LogEvent event, StringBuilder toAppendTo) { + toAppendTo.append("FakeConverter: ").append(event.getMessage().getFormattedMessage()); + } +} 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 e6178f2a17e..a5ba7ba61c5 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 @@ -300,7 +300,9 @@ public String visitArray(final ArrayType t, @Nullable Void unused) { @Override public @Nullable String visitDeclared(final DeclaredType t, final Void unused) { - return processingEnv.getTypeUtils().erasure(t).toString(); + return safeCast(t.asElement(), TypeElement.class) + .getQualifiedName() + .toString(); } }, null); diff --git a/src/changelog/.2.x.x/3796_annotated-array-parameters.xml b/src/changelog/.2.x.x/3796_annotated-array-parameters.xml new file mode 100644 index 00000000000..5be57fe6418 --- /dev/null +++ b/src/changelog/.2.x.x/3796_annotated-array-parameters.xml @@ -0,0 +1,12 @@ + + + + + Fix GraalVM reachability metadata generation for methods with annotated array type parameters, such as `@Nullable String[]`. + + From acbe411bc6d001337dd0bd5f130989e734ef39d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 22:49:21 +0200 Subject: [PATCH 21/31] Bump com.fasterxml.jackson:jackson-bom from 2.19.0 to 2.19.1 in /log4j-parent (#3745) * Update `com.fasterxml.jackson:jackson-bom` to version `2.19.1` (#3745) * Empty commit to trigger required checks --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Piotr P. Karwasz --- log4j-parent/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index f4e56806a27..4bfd9f733af 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -88,7 +88,7 @@ 3.0 2.2.2 2.7.4 - 2.19.0 + 2.19.1 2.1.3 2.1.3 diff --git a/pom.xml b/pom.xml index 10c52751dfa..a76d895090a 100644 --- a/pom.xml +++ b/pom.xml @@ -345,7 +345,7 @@ 1.2.21 4.0.0 1.11.0 - 2.19.0 + 2.19.1 1.6.2 4.0.5 18.3.12 From 28b477ceb383d845b921d65af37d381b1312f5a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 21:11:10 +0000 Subject: [PATCH 22/31] Update `org.junit:junit-bom` to version `5.13.2` (#3782) Co-authored-by: ASF Logging Services RM --- log4j-parent/pom.xml | 2 +- src/changelog/.2.x.x/update_org_junit_junit_bom.xml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/changelog/.2.x.x/update_org_junit_junit_bom.xml diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index 4bfd9f733af..d3ad93980cf 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -111,7 +111,7 @@ 1.37 1.0.0 4.13.2 - 5.13.1 + 5.13.2 1.9.1 3.9.1 0.2.0 diff --git a/src/changelog/.2.x.x/update_org_junit_junit_bom.xml b/src/changelog/.2.x.x/update_org_junit_junit_bom.xml new file mode 100644 index 00000000000..5c572a50a46 --- /dev/null +++ b/src/changelog/.2.x.x/update_org_junit_junit_bom.xml @@ -0,0 +1,8 @@ + + + + Update `org.junit:junit-bom` to version `5.13.2` + From 9577db6d2aaa84987f30b16baf3143a0a367351b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 21:11:24 +0000 Subject: [PATCH 23/31] Update `com.github.luben:zstd-jni` to version `1.5.7-4` (#3799) Co-authored-by: ASF Logging Services RM --- log4j-parent/pom.xml | 2 +- src/changelog/.2.x.x/update_com_github_luben_zstd_jni.xml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/changelog/.2.x.x/update_com_github_luben_zstd_jni.xml diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index d3ad93980cf..7da1ce0fafe 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -141,7 +141,7 @@ 2.35.2 2.10.3 1.10 - 1.5.7-3 + 1.5.7-4 + + + + Fix timestamp formatting concurrency issue, when `log4j2.enabledThreadlocals` is `true`. + + From 21a2300d2eea08e19e849091e53e3fa238537a05 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 4 Jul 2025 18:43:08 +0200 Subject: [PATCH 25/31] fix: Add GraalVM reachability metadata for non-plugin class instantiations (#3800) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `GraalVmProcessor` currently only generates metadata for Log4j plugins, overlooking other reflection usages in Log4j Core. This change adds reachability metadata for additional reflection cases to improve compatibility with GraalVM native images. ### Fixed Cases This PR addresses the following reflective instantiations: * **Context selectors and reliability strategies:** Ensures proper instantiation under GraalVM. * **`Configuration` instantiation in `DefaultConfigurationBuilder`:** Fixes support for the `log4j2.properties` configuration format when running on GraalVM. * **`BlockingQueue` instantiation in JSON Template Layout:** Enables GraalVM compatibility. Note: `MpmcArrayQueue` is not supported on GraalVM and must be fixed in the JCTools project. ### Known Limitations (Explicitly Ignored) The following cases are *not* addressed in this PR: * **JMX classes in `log4j-1.2-api`:** While GraalVM supports JMX, usage of Log4j 1.x’s JMX interface is likely minimal. * **`MulticastDnsAdvertiser`:** This feature is probably unused and could pose a security risk by advertising log file locations via mDNS. --- .../log4j-api/resource-config.json | 2 +- .../log4j-core/reflect-config.json | 120 ++++++++++++++++++ .../log4j-core/resource-config.json | 2 +- .../reflect-config.json | 24 ++++ .../resource-config.json | 1 + .../.2.x.x/3800_graalvm-misc-reflection.xml | 12 ++ 6 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/reflect-config.json create mode 100644 log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/reflect-config.json create mode 100644 src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml diff --git a/log4j-api/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-api/resource-config.json b/log4j-api/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-api/resource-config.json index 1649e6be1ef..9b4eb75dc63 100644 --- a/log4j-api/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-api/resource-config.json +++ b/log4j-api/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-api/resource-config.json @@ -6,4 +6,4 @@ } ] } -} \ No newline at end of file +} diff --git a/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/reflect-config.json b/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/reflect-config.json new file mode 100644 index 00000000000..5411a855b98 --- /dev/null +++ b/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/reflect-config.json @@ -0,0 +1,120 @@ +[ + { + "name": "org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.logging.log4j.core.LoggerContext", + "org.apache.logging.log4j.core.config.ConfigurationSource", + "org.apache.logging.log4j.core.config.builder.api.Component" + ] + } + ], + "fields": [] + }, + { + "name": "org.apache.logging.log4j.core.config.properties.PropertiesConfiguration", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.apache.logging.log4j.core.LoggerContext", + "org.apache.logging.log4j.core.config.ConfigurationSource", + "org.apache.logging.log4j.core.config.builder.api.Component" + ] + } + ], + "fields": [] + }, + { + "name": "org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.selector.BasicContextSelector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.selector.JndiContextSelector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.selector.ClassLoaderContextSelector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.osgi.BundleContextSelector", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.config.LockingReliabilityStrategy", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.config.AwaitUnconditionallyReliabilityStrategy", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.config.DefaultReliabilityStrategy", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + } +] diff --git a/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/resource-config.json b/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/resource-config.json index d5b51667ed9..9f1049ed8ba 100644 --- a/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/resource-config.json +++ b/log4j-core/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-core/resource-config.json @@ -9,4 +9,4 @@ } ] } -} \ No newline at end of file +} diff --git a/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/reflect-config.json b/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/reflect-config.json new file mode 100644 index 00000000000..c4e3872cd69 --- /dev/null +++ b/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/reflect-config.json @@ -0,0 +1,24 @@ +[ + { + "name": "org.jctools.queues.MpmcArrayQueue", + "methods": [ + { + "name": "", + "parameterTypes": [ + "int" + ] + } + ] + }, + { + "name": "java.util.concurrent.ArrayBlockingQueue", + "methods": [ + { + "name": "", + "parameterTypes": [ + "int" + ] + } + ] + } +] diff --git a/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/resource-config.json b/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/resource-config.json index c8afe14794a..55c503ebebc 100644 --- a/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/resource-config.json +++ b/log4j-layout-template-json/src/main/resources/META-INF/native-image/org.apache.logging.log4j/log4j-layout-template-json/resource-config.json @@ -7,3 +7,4 @@ ] } } + diff --git a/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml b/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml new file mode 100644 index 00000000000..3e6653c121f --- /dev/null +++ b/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml @@ -0,0 +1,12 @@ + + + + + Resolves `PropertiesConfiguration` compatibility issues with GraalVM and addresses additional minor reflection-related problems. + + From 76090f86ba7e46b4efa3e7bf795f11afe53de7c9 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 4 Jul 2025 20:33:11 +0200 Subject: [PATCH 26/31] fix: Add `resource:` protocol to allowed URL schemes by default (#3795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Add `resource:` protocol to allowed URL schemes by default This update includes `resource:` in the list of allowed URL schemes for retrieving configuration files. See [`log4j2.configurationAllowedProtocols`](https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.configurationAllowedProtocols) Currently, the `resource:` protocol is used exclusively by a `URLStreamHandler` that retrieves files from the embedded resources in a GraalVM native image. This makes it a secure and appropriate source for trusted configuration files. This change cannot be easily and reliably tested through a unit test. An integration test will be provided in apache/logging-log4j-samples#345 Closes #3790 * fix: Add `resource` protocol only in native images This change introduces an internal `SystemUtils.isGraalVm()` method to detect the presence of GraalVM and enable the `resource` protocol. * Reword changelog entry --------- Co-authored-by: Volkan Yazıcı --- .../log4j/core/net/UrlConnectionFactory.java | 20 ++++++++++++++++++- .../log4j/core/util/internal/SystemUtils.java | 16 +++++++++++++++ .../.2.x.x/3790_allow-resource-protocol.xml | 12 +++++++++++ .../properties-transport-security.adoc | 14 ++++++++++--- 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 src/changelog/.2.x.x/3790_allow-resource-protocol.xml diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/UrlConnectionFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/UrlConnectionFactory.java index e6ba2a13665..e98d3d9a9db 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/UrlConnectionFactory.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/UrlConnectionFactory.java @@ -33,6 +33,7 @@ import org.apache.logging.log4j.core.net.ssl.SslConfiguration; import org.apache.logging.log4j.core.net.ssl.SslConfigurationFactory; import org.apache.logging.log4j.core.util.AuthorizationProvider; +import org.apache.logging.log4j.core.util.internal.SystemUtils; import org.apache.logging.log4j.util.PropertiesUtil; import org.apache.logging.log4j.util.Strings; @@ -51,7 +52,24 @@ public class UrlConnectionFactory { private static final String HTTP = "http"; private static final String HTTPS = "https"; private static final String JAR = "jar"; - private static final String DEFAULT_ALLOWED_PROTOCOLS = "https, file, jar"; + /** + * Default list of protocols that are allowed to be used for configuration files and other trusted resources. + *

+ * By default, we trust the following protocols: + *

+ *
file
+ *
Local files
+ *
https
+ *
Resources retrieved through TLS to guarantee their integrity
+ *
jar
+ *
Resources retrieved from JAR files
+ *
resource
+ *
Resources embedded in a GraalVM native image
+ *
+ */ + private static final String DEFAULT_ALLOWED_PROTOCOLS = + SystemUtils.isGraalVm() ? "file, https, jar, resource" : "file, https, jar"; + private static final String NO_PROTOCOLS = "_none"; public static final String ALLOWED_PROTOCOLS = "log4j2.Configuration.allowedProtocols"; diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/SystemUtils.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/SystemUtils.java index b7b3d9cbb4d..23d60ce688a 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/SystemUtils.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/SystemUtils.java @@ -36,5 +36,21 @@ public static boolean isOsAndroid() { return getJavaVendor().contains("Android"); } + /** + * Checks if the current runtime is GraalVM. + *

+ * See ImageInfo.PROPERTY_IMAGE_CODE_KEY. + *

+ * @return true if the current runtime is GraalVM, false otherwise. + */ + public static boolean isGraalVm() { + try { + return System.getProperty("org.graalvm.nativeimage.imagecode") != null; + } catch (final SecurityException e) { + LOGGER.debug("Unable to determine if the current runtime is GraalVM.", e); + return false; + } + } + private SystemUtils() {} } diff --git a/src/changelog/.2.x.x/3790_allow-resource-protocol.xml b/src/changelog/.2.x.x/3790_allow-resource-protocol.xml new file mode 100644 index 00000000000..ffa3c80e305 --- /dev/null +++ b/src/changelog/.2.x.x/3790_allow-resource-protocol.xml @@ -0,0 +1,12 @@ + + + + + Allow `resource:` protocol for configuration files by default, if the current runtime is GraalVM. + + diff --git a/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-transport-security.adoc b/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-transport-security.adoc index 445c9ec5418..3c662698c95 100644 --- a/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-transport-security.adoc +++ b/src/site/antora/modules/ROOT/partials/manual/systemproperties/properties-transport-security.adoc @@ -21,9 +21,17 @@ [cols="1h,5"] |=== -| Env. variable | `LOG4J_CONFIGURATION_ALLOWED_PROTOCOLS` -| Type | Comma-separated list of https://docs.oracle.com/javase/{java-target-version}/docs/api/java/net/URL.html[`URL`] protocols -| Default value | `file, https, jar` +| Env. variable +| `LOG4J_CONFIGURATION_ALLOWED_PROTOCOLS` + +| Type +| Comma-separated list of https://docs.oracle.com/javase/{java-target-version}/docs/api/java/net/URL.html[`URL`] protocols + +| Default value +| +`file, https, jar` (JVM) + +`file, https, jar, resource` (GraalVM) |=== A comma separated list of https://docs.oracle.com/javase/{java-target-version}/docs/api/java/net/URL.html[`URL`] protocols that may be used to load any kind of configuration source. From f26e0418d354475f4296031a8b1a17b2e011b4c7 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 5 Jul 2025 21:13:47 +0200 Subject: [PATCH 27/31] fix: Proof-read changelog for version `2.25.1` --- src/changelog/.2.x.x/3706_disruptor-tccl.xml | 2 +- ...b_luben_zstd_jni.xml => 3754_fix-gradle-build.xml} | 8 +++++--- src/changelog/.2.x.x/3758_fix_jspecify_dep.xml | 10 +++++----- src/changelog/.2.x.x/3770_LoggerContext_start.xml | 2 +- src/changelog/.2.x.x/3771_graalvm-params.xml | 4 ++-- ...karta-web_relax_the_import_package_constraints.xml | 11 +++++------ src/changelog/.2.x.x/3790_allow-resource-protocol.xml | 2 +- .../.2.x.x/3796_annotated-array-parameters.xml | 9 +++++---- src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml | 2 +- ...clipse_persistence_org_eclipse_persistence_jpa.xml | 8 -------- src/changelog/.2.x.x/update_org_junit_junit_bom.xml | 8 -------- .../.2.x.x/update_org_xmlunit_xmlunit_core.xml | 8 -------- 12 files changed, 26 insertions(+), 48 deletions(-) rename src/changelog/.2.x.x/{update_com_github_luben_zstd_jni.xml => 3754_fix-gradle-build.xml} (55%) delete mode 100644 src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml delete mode 100644 src/changelog/.2.x.x/update_org_junit_junit_bom.xml delete mode 100644 src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml diff --git a/src/changelog/.2.x.x/3706_disruptor-tccl.xml b/src/changelog/.2.x.x/3706_disruptor-tccl.xml index a6a446fb14f..959f1b78d2a 100644 --- a/src/changelog/.2.x.x/3706_disruptor-tccl.xml +++ b/src/changelog/.2.x.x/3706_disruptor-tccl.xml @@ -7,6 +7,6 @@ type="fixed"> - Fix detection of the Disruptor major version in some environments. + Fix detection of the Disruptor major version in environments with non-standard thread context classloader. diff --git a/src/changelog/.2.x.x/update_com_github_luben_zstd_jni.xml b/src/changelog/.2.x.x/3754_fix-gradle-build.xml similarity index 55% rename from src/changelog/.2.x.x/update_com_github_luben_zstd_jni.xml rename to src/changelog/.2.x.x/3754_fix-gradle-build.xml index 979784e1e2d..cfaae2512a8 100644 --- a/src/changelog/.2.x.x/update_com_github_luben_zstd_jni.xml +++ b/src/changelog/.2.x.x/3754_fix-gradle-build.xml @@ -2,7 +2,9 @@ - - Update `com.github.luben:zstd-jni` to version `1.5.7-4` + type="fixed"> + + + Downgrade `spotbugs-annotations` to resolve Gradle build failures. + diff --git a/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml b/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml index 78dba40899a..db97f93c0ef 100644 --- a/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml +++ b/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml @@ -5,9 +5,9 @@ https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" type="fixed"> - - - - Fix version resolution of `jspecify` and `error_prone_annotations` dependencies in published POM files. - + + + + Fix incorrect version resolution of `jspecify` and `error_prone_annotations` dependencies in published POM files. + diff --git a/src/changelog/.2.x.x/3770_LoggerContext_start.xml b/src/changelog/.2.x.x/3770_LoggerContext_start.xml index 84416d9c546..33fd627d56f 100644 --- a/src/changelog/.2.x.x/3770_LoggerContext_start.xml +++ b/src/changelog/.2.x.x/3770_LoggerContext_start.xml @@ -7,6 +7,6 @@ type="fixed"> - Restore backward compatibility with the Spring Boot reconfiguration process. + Restore compatibility with Spring Boot by allowing reconfiguration using the `LoggerContext.start` method. diff --git a/src/changelog/.2.x.x/3771_graalvm-params.xml b/src/changelog/.2.x.x/3771_graalvm-params.xml index ff3c79b1efa..640f3d3b3da 100644 --- a/src/changelog/.2.x.x/3771_graalvm-params.xml +++ b/src/changelog/.2.x.x/3771_graalvm-params.xml @@ -2,9 +2,9 @@ + type="fixed"> - Make `-Alog4j.graalvm.groupId` and `-Alog4j.graalvm.artifactId` arguments optional. + Allow omission of the `-Alog4j.graalvm.groupId` and `-Alog4j.graalvm.artifactId` arguments when building Log4j plugins. diff --git a/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml b/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml index 9602fb8af87..4e0182c1e97 100644 --- a/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml +++ b/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml @@ -4,10 +4,9 @@ xsi:schemaLocation=" https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" - type="changed"> - - - add a bnd tool property that makes sure that the supported jakarta version has a wider range then 5 to 6 - Support the current release version for 5 to 7 - + type="fixed"> + + + Broaden the OSGi manifest's `Import-Package` constraints to support Jakarta Servlet API up to version 6. + diff --git a/src/changelog/.2.x.x/3790_allow-resource-protocol.xml b/src/changelog/.2.x.x/3790_allow-resource-protocol.xml index ffa3c80e305..dd0394225b6 100644 --- a/src/changelog/.2.x.x/3790_allow-resource-protocol.xml +++ b/src/changelog/.2.x.x/3790_allow-resource-protocol.xml @@ -7,6 +7,6 @@ type="fixed"> - Allow `resource:` protocol for configuration files by default, if the current runtime is GraalVM. + Enable the `resource:` protocol for configuration files by default when running on GraalVM. diff --git a/src/changelog/.2.x.x/3796_annotated-array-parameters.xml b/src/changelog/.2.x.x/3796_annotated-array-parameters.xml index 5be57fe6418..ac8be7cedcd 100644 --- a/src/changelog/.2.x.x/3796_annotated-array-parameters.xml +++ b/src/changelog/.2.x.x/3796_annotated-array-parameters.xml @@ -5,8 +5,9 @@ https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd" type="fixed"> - - - Fix GraalVM reachability metadata generation for methods with annotated array type parameters, such as `@Nullable String[]`. - + + + Fix GraalVM reachability metadata generation for methods with annotated array type parameters, such as `@Nullable + String[]`. + diff --git a/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml b/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml index 3e6653c121f..8c2e9583344 100644 --- a/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml +++ b/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml @@ -7,6 +7,6 @@ type="fixed"> - Resolves `PropertiesConfiguration` compatibility issues with GraalVM and addresses additional minor reflection-related problems. + Resolve `PropertiesConfiguration` compatibility issues with GraalVM and address additional minor reflection-related problems. diff --git a/src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml b/src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml deleted file mode 100644 index eb8c8ba8d0d..00000000000 --- a/src/changelog/.2.x.x/update_org_eclipse_persistence_org_eclipse_persistence_jpa.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Update `org.eclipse.persistence:org.eclipse.persistence.jpa` to version `2.7.16` - diff --git a/src/changelog/.2.x.x/update_org_junit_junit_bom.xml b/src/changelog/.2.x.x/update_org_junit_junit_bom.xml deleted file mode 100644 index 5c572a50a46..00000000000 --- a/src/changelog/.2.x.x/update_org_junit_junit_bom.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Update `org.junit:junit-bom` to version `5.13.2` - diff --git a/src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml b/src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml deleted file mode 100644 index e00bd7e1546..00000000000 --- a/src/changelog/.2.x.x/update_org_xmlunit_xmlunit_core.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Update `org.xmlunit:xmlunit-core` to version `2.10.3` - From 63e8932178c13c46bcda4ab367cbd5742de8826b Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sat, 5 Jul 2025 21:35:50 +0200 Subject: [PATCH 28/31] doc: Prepare release notes for version `2.25.1` --- pom.xml | 10 +++---- src/changelog/2.25.1/.release-notes.adoc.ftl | 30 +++++++++++++++++++ src/changelog/2.25.1/.release.xml | 21 +++++++++++++ .../3706_disruptor-tccl.xml | 0 .../3754_fix-gradle-build.xml | 0 .../3758_fix_jspecify_dep.xml | 0 .../3770_LoggerContext_start.xml | 0 .../3771_graalvm-params.xml | 0 ...b_relax_the_import_package_constraints.xml | 0 .../3790_allow-resource-protocol.xml | 0 .../3792_formatted-datetime-sharing.xml | 0 .../3796_annotated-array-parameters.xml | 0 .../3800_graalvm-misc-reflection.xml | 0 13 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 src/changelog/2.25.1/.release-notes.adoc.ftl create mode 100644 src/changelog/2.25.1/.release.xml rename src/changelog/{.2.x.x => 2.25.1}/3706_disruptor-tccl.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3754_fix-gradle-build.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3758_fix_jspecify_dep.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3770_LoggerContext_start.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3771_graalvm-params.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3787_jakarta-web_relax_the_import_package_constraints.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3790_allow-resource-protocol.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3792_formatted-datetime-sharing.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3796_annotated-array-parameters.xml (100%) rename src/changelog/{.2.x.x => 2.25.1}/3800_graalvm-misc-reflection.xml (100%) diff --git a/pom.xml b/pom.xml index a76d895090a..ac58d566045 100644 --- a/pom.xml +++ b/pom.xml @@ -279,7 +279,7 @@ scm:git:https://github.com/apache/logging-log4j2.git scm:git:https://github.com/apache/logging-log4j2.git - rel/2.25.0 + rel/2.25.1 https://github.com/apache/logging-log4j2 @@ -307,11 +307,11 @@ - 2.25.1-SNAPSHOT + 2.25.1 - 2.25.0 - 2.25.0 - 2.25.0 + 2.25.1 + 2.25.1 + 2.25.1 + diff --git a/src/changelog/.2.x.x/3706_disruptor-tccl.xml b/src/changelog/2.25.1/3706_disruptor-tccl.xml similarity index 100% rename from src/changelog/.2.x.x/3706_disruptor-tccl.xml rename to src/changelog/2.25.1/3706_disruptor-tccl.xml diff --git a/src/changelog/.2.x.x/3754_fix-gradle-build.xml b/src/changelog/2.25.1/3754_fix-gradle-build.xml similarity index 100% rename from src/changelog/.2.x.x/3754_fix-gradle-build.xml rename to src/changelog/2.25.1/3754_fix-gradle-build.xml diff --git a/src/changelog/.2.x.x/3758_fix_jspecify_dep.xml b/src/changelog/2.25.1/3758_fix_jspecify_dep.xml similarity index 100% rename from src/changelog/.2.x.x/3758_fix_jspecify_dep.xml rename to src/changelog/2.25.1/3758_fix_jspecify_dep.xml diff --git a/src/changelog/.2.x.x/3770_LoggerContext_start.xml b/src/changelog/2.25.1/3770_LoggerContext_start.xml similarity index 100% rename from src/changelog/.2.x.x/3770_LoggerContext_start.xml rename to src/changelog/2.25.1/3770_LoggerContext_start.xml diff --git a/src/changelog/.2.x.x/3771_graalvm-params.xml b/src/changelog/2.25.1/3771_graalvm-params.xml similarity index 100% rename from src/changelog/.2.x.x/3771_graalvm-params.xml rename to src/changelog/2.25.1/3771_graalvm-params.xml diff --git a/src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml b/src/changelog/2.25.1/3787_jakarta-web_relax_the_import_package_constraints.xml similarity index 100% rename from src/changelog/.2.x.x/3787_jakarta-web_relax_the_import_package_constraints.xml rename to src/changelog/2.25.1/3787_jakarta-web_relax_the_import_package_constraints.xml diff --git a/src/changelog/.2.x.x/3790_allow-resource-protocol.xml b/src/changelog/2.25.1/3790_allow-resource-protocol.xml similarity index 100% rename from src/changelog/.2.x.x/3790_allow-resource-protocol.xml rename to src/changelog/2.25.1/3790_allow-resource-protocol.xml diff --git a/src/changelog/.2.x.x/3792_formatted-datetime-sharing.xml b/src/changelog/2.25.1/3792_formatted-datetime-sharing.xml similarity index 100% rename from src/changelog/.2.x.x/3792_formatted-datetime-sharing.xml rename to src/changelog/2.25.1/3792_formatted-datetime-sharing.xml diff --git a/src/changelog/.2.x.x/3796_annotated-array-parameters.xml b/src/changelog/2.25.1/3796_annotated-array-parameters.xml similarity index 100% rename from src/changelog/.2.x.x/3796_annotated-array-parameters.xml rename to src/changelog/2.25.1/3796_annotated-array-parameters.xml diff --git a/src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml b/src/changelog/2.25.1/3800_graalvm-misc-reflection.xml similarity index 100% rename from src/changelog/.2.x.x/3800_graalvm-misc-reflection.xml rename to src/changelog/2.25.1/3800_graalvm-misc-reflection.xml From 4e1bbca31cc0bafc449e40def77bbaa3fe318ec9 Mon Sep 17 00:00:00 2001 From: ASF Logging Services RM Date: Sat, 5 Jul 2025 20:15:23 +0000 Subject: [PATCH 29/31] Update the `project.build.outputTimestamp` property --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ac58d566045..31f62e79278 100644 --- a/pom.xml +++ b/pom.xml @@ -325,7 +325,7 @@ 2. This value is employed in various places while creating the distribution To mitigate these, we define a *dummy* value here and let the CI replace it during a release. Hence, *DO NOT MANUALLY EDIT THIS VALUE*! --> - 2025-06-13T17:08:55Z + 2025-07-05T19:48:56Z