Skip to content

modules: add slf4j-nop where it is missing#132770

Closed
xnox wants to merge 1 commit intoelastic:mainfrom
xnox:slf4j-warnings
Closed

modules: add slf4j-nop where it is missing#132770
xnox wants to merge 1 commit intoelastic:mainfrom
xnox:slf4j-warnings

Conversation

@xnox
Copy link
Copy Markdown

@xnox xnox commented Aug 12, 2025

Default startup of elasticsearch results in warnings:

[WARN ][stderr ] [es] SLF4J: No SLF4J providers were found.
[WARN ][stderr ] [es] SLF4J: Defaulting to no-operation (NOP) logger implementation
[WARN ][stderr ] [es] SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.

It seems like most modules and plugins install nop logger, but some don't. If one installs them everywhere, these warnings seem to go away.

Default startup of elasticsearch results in warnings:

> [WARN ][stderr ] [es] SLF4J: No SLF4J providers were found.
> [WARN ][stderr ] [es] SLF4J: Defaulting to no-operation (NOP) logger implementation
> [WARN ][stderr ] [es] SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.

It seems like most modules and plugins install nop logger, but some
don't. If one installs them everywhere, these warnings seem to go
away.
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.2.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Aug 12, 2025
@xnox
Copy link
Copy Markdown
Author

xnox commented Aug 13, 2025

I think this is possibly CC @rjernst and ping to @elastic/es-core-infra (Team:Core/Infra) and is like :Core/Infra/Logging despite being a change to gradle dependencies.

@rjernst
Copy link
Copy Markdown
Member

rjernst commented Aug 14, 2025

The warning is telling us we are hiding any messages sent to slf4j in these plugins. Adding the nop jar only makes the warning go away, but doesn't fix the problem. I think instead we want a bridge.

@xnox
Copy link
Copy Markdown
Author

xnox commented Aug 14, 2025

The warning is telling us we are hiding any messages sent to slf4j in these plugins. Adding the nop jar only makes the warning go away, but doesn't fix the problem. I think instead we want a bridge.

Ok!

All other plugins that include slf4j API jar, also include the nop jar already - do they also need to be changing?

@rjernst
Copy link
Copy Markdown
Member

rjernst commented Aug 14, 2025

Yes, any plugin using slf4j should be changed.

@rjernst rjernst self-assigned this Aug 14, 2025
@rjernst rjernst self-requested a review August 14, 2025 12:29
@gareth-ellis gareth-ellis added the :Core/Infra/Core Core issues without another label label Aug 15, 2025
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team and removed needs:triage Requires assignment of a team area label labels Aug 15, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@fbaligand
Copy link
Copy Markdown
Contributor

In order to not loose all logs that come through slf4j, it would be nice to add "log4j-slf4j-impl" dependency for each module that requires "slf4j-api" dependency.
Like "x-pack-ent-search" module does.

@DaveCTurner
Copy link
Copy Markdown
Member

I'm closing this because it's not the approach we want. I opened #137556 in its place to record the work to be done in this area.

@DaveCTurner DaveCTurner closed this Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Core/Infra Meta label for core/infra team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants