Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure repository is missing log4j-slf4j-impl dependency #83652

Closed
pgomulka opened this issue Feb 8, 2022 · 2 comments · Fixed by #83661
Closed

Azure repository is missing log4j-slf4j-impl dependency #83652

pgomulka opened this issue Feb 8, 2022 · 2 comments · Fixed by #83661
Labels
>bug :Core/Infra/Logging Log management and logging utilities :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v8.0.0

Comments

@pgomulka
Copy link
Contributor

pgomulka commented Feb 8, 2022

Elasticsearch Version

8.0

Installed Plugins

repository_azure

Java Version

bundled

OS Version

macos

Problem Description

ES never had a dependency on slf4j, however azure repository does. This plugin default to no op logger implementation and emits a warning into logs

[2022-01-28T15:35:44,847][WARN ][stderr                   ] [runTask-0] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[2022-01-28T15:35:44,848][WARN ][stderr                   ] [runTask-0] SLF4J: Defaulting to no-operation (NOP) logger implementation
[2022-01-28T15:35:44,849][WARN ][stderr                   ] [runTask-0] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

The stacktrace for this warning is

bind:135, LoggerFactory (org.slf4j)
performInitialization:108, LoggerFactory (org.slf4j)
getILoggerFactory:279, LoggerFactory (org.slf4j)
getLogger:252, LoggerFactory (org.slf4j)
<init>:58, ClientLogger (com.azure.core.util.logging)
<init>:48, ClientLogger (com.azure.core.util.logging)
<init>:49, JacksonAdapter (com.azure.core.util.serializer)
createDefaultSerializerAdapter:112, JacksonAdapter (com.azure.core.util.serializer)
<clinit>:55, AzureRepositoryPlugin (org.elasticsearch.repositories.azure)
newInstance0:-1, NativeConstructorAccessorImpl (jdk.internal.reflect)
newInstance:77, NativeConstructorAccessorImpl (jdk.internal.reflect)
newInstance:45, DelegatingConstructorAccessorImpl (jdk.internal.reflect)
newInstanceWithCaller:499, Constructor (java.lang.reflect)
newInstance:480, Constructor (java.lang.reflect)
loadPlugin:762, PluginsService (org.elasticsearch.plugins)
loadBundle:709, PluginsService (org.elasticsearch.plugins)
loadBundles:492, PluginsService (org.elasticsearch.plugins)
<init>:165, PluginsService (org.elasticsearch.plugins)
<init>:377, Node (org.elasticsearch.node)
<init>:277, Node (org.elasticsearch.node)
<init>:234, Bootstrap$5 (org.elasticsearch.bootstrap)
setup:234, Bootstrap (org.elasticsearch.bootstrap)
init:358, Bootstrap (org.elasticsearch.bootstrap)
init:166, Elasticsearch (org.elasticsearch.bootstrap)
execute:157, Elasticsearch (org.elasticsearch.bootstrap)
execute:77, EnvironmentAwareCommand (org.elasticsearch.cli)
mainWithoutErrorHandling:112, Command (org.elasticsearch.cli)
main:77, Command (org.elasticsearch.cli)
main:122, Elasticsearch (org.elasticsearch.bootstrap)
main:80, Elasticsearch (org.elasticsearch.bootstrap)

The problem become visible since #81870 made repository_azure a module (an always loaded plugin). Hence we can observe this warning on very startup when modules are loaded.

Should we add log4j-slf4j-impl dependency?
or Should we ignore this, "strip"/hide those warnings? From what I see in ClientLogger from azure-core it would just use System.out.println for logging.

        logger = initLogger instanceof NOPLogger ? new DefaultLogger(className) : initLogger;

Steps to Reproduce

checkout any revision after 29349f4 and start ES

Logs (if relevant)

No response

@pgomulka pgomulka added >bug needs:triage Requires assignment of a team area label :Core/Infra/Logging Log management and logging utilities :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts labels Feb 8, 2022
@elasticmachine elasticmachine added Team:Core/Infra Meta label for core/infra team Team:Delivery Meta label for Delivery team labels Feb 8, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@pgomulka pgomulka added v8.0.0 and removed Team:Core/Infra Meta label for core/infra team Team:Delivery Meta label for Delivery team needs:triage Requires assignment of a team area label labels Feb 8, 2022
@pgomulka pgomulka changed the title Azure repository is missing sf4j dependency Azure repository is missing log4j-slf4j-impl dependency Feb 8, 2022
pgomulka added a commit to pgomulka/elasticsearch that referenced this issue Feb 8, 2022
repository azure plugin is using azure-core which depends on sl4j for
logging. Slf4j requires a bridge to log into log4j2 otherwise it emitts
a warning to STDOUT and all further logs also to STDOUT.
This commit addes the missing log4j-sl4j-impl which is a bridge between
slf4j API and log4j implementation

closes elastic#83652
pgomulka added a commit that referenced this issue Feb 9, 2022
repository azure plugin is using azure-core which depends on sl4j for
logging. Slf4j requires a bridge to log into log4j2 otherwise it emitts
a warning to STDOUT and all further logs also to STDOUT.
This commit addes the missing log4j-sl4j-impl which is a bridge between
slf4j API and log4j implementation

closes #83652
pgomulka added a commit to pgomulka/elasticsearch that referenced this issue Feb 9, 2022
repository azure plugin is using azure-core which depends on sl4j for
logging. Slf4j requires a bridge to log into log4j2 otherwise it emitts
a warning to STDOUT and all further logs also to STDOUT.
This commit addes the missing log4j-sl4j-impl which is a bridge between
slf4j API and log4j implementation

closes elastic#83652
pgomulka added a commit to pgomulka/elasticsearch that referenced this issue Feb 9, 2022
repository azure plugin is using azure-core which depends on sl4j for
logging. Slf4j requires a bridge to log into log4j2 otherwise it emitts
a warning to STDOUT and all further logs also to STDOUT.
This commit addes the missing log4j-sl4j-impl which is a bridge between
slf4j API and log4j implementation

closes elastic#83652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Logging Log management and logging utilities :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants