diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index a65de8736a2b..8d5e47fbc9da 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -8,6 +8,9 @@ ### Bugs Fixed +- Fixed GraalVM native-image compilation with SLF4J 2 by no longer forcing Azure Core logging and logging provider + classes to initialize at image build time. ([#49844](https://github.com/Azure/azure-sdk-for-java/issues/49844)) + ### Other Changes ## 1.58.1 (2026-06-08) diff --git a/sdk/core/azure-core/README.md b/sdk/core/azure-core/README.md index 108661e2c1d3..d6092ac6c874 100644 --- a/sdk/core/azure-core/README.md +++ b/sdk/core/azure-core/README.md @@ -219,6 +219,14 @@ Azure SDKs for Java provide a consistent logging story to help aid in troublesho their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging][logging] documentation for guidance about enabling logging. +### GraalVM Native Image + +Azure Core includes reachability metadata for GraalVM Native Image. Logging APIs and providers are initialized at +application runtime so that the provider configured by the application or framework is selected correctly. Applications +should not need Azure-specific build-time initialization arguments for `org.slf4j.LoggerFactory` or +`com.azure.core.util.logging.ClientLogger`. Configuration specific to a logging provider remains the responsibility of +the application or framework. + #### HTTP Request and Response Logging HTTP request and response logging can be enabled by setting `HttpLogDetailLevel` in the `HttpLogOptions` used to create @@ -264,4 +272,3 @@ the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/C [jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable [java8_client_compatibility]: https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis - diff --git a/sdk/core/azure-core/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties b/sdk/core/azure-core/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties index 202683e925b4..58be8e327770 100644 --- a/sdk/core/azure-core/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties +++ b/sdk/core/azure-core/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties @@ -1,38 +1,10 @@ Args=\ -H:+AddAllCharsets \ -H:+ReportExceptionStackTraces \ - --initialize-at-build-time=ch.qos.logback.classic.Level,\ - ch.qos.logback.classic.Logger,\ - ch.qos.logback.classic.PatternLayout,\ - ch.qos.logback.core.CoreConstants,\ - ch.qos.logback.core.pattern.parser.Parser,\ - ch.qos.logback.core.spi.AppenderAttachableImpl,\ - ch.qos.logback.core.status.InfoStatus,\ - ch.qos.logback.core.status.StatusBase,\ - ch.qos.logback.core.util.Loader,\ - ch.qos.logback.core.util.StatusPrinter,\ - ch.qos.logback.core.util.StatusPrinter2,\ - org.apache.log4j.Logger,\ - org.slf4j.MDC,\ - org.slf4j.LoggerFactory,\ - org.slf4j.impl.StaticLoggerBinder,\ - com.azure.core.util.logging.LogLevel,\ - com.azure.core.implementation.logging.DefaultLogger,\ - com.azure.core.test.TestBase,\ - com.azure.core.util.Configuration,\ - com.azure.core.util.logging.ClientLogger,\ - com.azure.core.implementation.util.EnvironmentConfiguration,\ - com.azure.core.implementation.util.EnvironmentConfiguration$EnvironmentVariablesConfigurationSource,\ - com.azure.core.util.CoreUtils,\ - com.azure.core.util.NoopConfiguration,\ - com.azure.core.util.logging.LoggingEventBuilder,\ - com.fasterxml.jackson.core.Base64Variants,\ + --initialize-at-build-time=com.fasterxml.jackson.core.Base64Variants,\ com.fasterxml.jackson.core.JsonFactory,\ com.fasterxml.jackson.core.io.CharTypes,\ com.fasterxml.jackson.core.io.JsonStringEncoder,\ com.fasterxml.jackson.core.io.SerializedString,\ com.fasterxml.jackson.databind.MappingJsonFactory - - -