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

NamedLogHandlersBuildItem causes stderr "Handler is linked to a category but not configured" #45645

Closed
rquinio1A opened this issue Jan 16, 2025 · 5 comments · Fixed by #45705
Closed
Labels
area/logging kind/bug Something isn't working
Milestone

Comments

@rquinio1A
Copy link
Contributor

Describe the bug

We've added support for named log handlers in quarkus-logging-splunk extension, thanks to Quarkus NamedLogHandlersBuildItem that was introduced in #7568

Our config looks like:

quarkus.log.handler.splunk."MONITORING".key=value
quarkus.log.category."monitoring".handlers=MONITORING

The extension builds one handler for every nested quarkus.log.handler.splunk."named-handler" config entries, and registers them at runtime init via NamedLogHandlersBuildItem.

Even though the log category and handler work properly, there's an stderr log at Quarkus startup:
LogManager error of type GENERIC_FAILURE: Handler with name 'MONITORING' is linked to a category but not configured.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Run https://github.com/quarkiverse/quarkus-logging-splunk/blob/main/deployment/src/test/java/io/quarkiverse/logging/splunk/LoggingSplunkNamedHandlerConfigTest.java
In the console stderr:
LogManager error of type GENERIC_FAILURE: Handler with name 'MONITORING' is linked to a category but not configured.

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.15.2

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

Intially reported in quarkiverse/quarkus-logging-splunk#319
This is reproducible with Quarkus 3.2, 3.8 and 3.15
The core handlers (console, file, ...) don't rely on NamedLogHandlersBuildItem , so I suspect the issue has always been present because it's not directly used in Quarkus itself.
Maybe the check on quarkus.log.category.handlers happens before NamedLogHandlersBuildItem are consumed ?

@rquinio1A rquinio1A added the kind/bug Something isn't working label Jan 16, 2025
Copy link

quarkus-bot bot commented Jan 16, 2025

/cc @radcortez (config)

@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

Maybe the check on quarkus.log.category.handlers happens before NamedLogHandlersBuildItem are consumed ?

I think it makes sense. Would you like to contribute that?

@rquinio1A
Copy link
Contributor Author

rquinio1A commented Jan 16, 2025

@geoand I've done some debugging and the setup of categories is done twice:

So a naive fix would be to remove the first call.

@gsmet
Copy link
Member

gsmet commented Jan 16, 2025

We need to set up the categories for build time, but we probably need to ignore the config for the named handlers.

@geoand
Copy link
Contributor

geoand commented Jan 17, 2025

Makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants