-
Howdy folks, We recently migrated our backend from WildFly to Quarkus. The transition was smooth, Quarkus is running reliably, and while our primary drivers were improved developer experience, observability, and ease of upgrades, we also observed a performance boost - which was a nice bonus. Kudos to everyone involved in building and maintaining Quarkus - it's a solid framework. Now, here's the issue I'm trying to solve: We have custom logging requirements that we currently meet by implementing a custom SLF4J provider. This works as expected in production mode, but in dev mode, the provider is ignored. Here's a minimal reproducer using Gradle: When I build the app via
The duplicate provider issue can be resolved by excluding the default SLF4J binding in configurations {
configureEach {
exclude group: 'org.jboss.slf4j', module: 'slf4j-jboss-logmanager'
}
} However, when running in dev mode via So, is there a recommended approach to get a custom I understand that Quarkus enforces JBoss LogManager as the underlying logging backend (1, 2). However, the fact that a custom SLF4J provider works in production suggests that alternative implementations are technically viable - at least in prod mode - via the SLF4J SPI. For additional context: we need precise control over how stack traces are printed in logs, as this impacts how our cloud-based error reporting platform parses and groups exceptions. One might suggest implementing a custom Any guidance or best practices for handling this in dev mode would be greatly appreciated. And one bonus question I have is: is there any mechanism that allows one to specify dependencies that should be loaded by If any of this sounds like a bug or design gap, I’d be happy to contribute and help fix it - assuming you think it makes sense. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Thanks for reporting the issue with a reproducer. The first thing to try (as a workaround) would be to use the customer logging provider as an external dependency instead of a subproject. |
Beta Was this translation helpful? Give feedback.
-
Thanks @aloubyansky. I did try what you proposed, you can reproduce it in branch To reproduce:
So unfortunately it's still same. Bear in mind though, that I'm not a maven guy so there is a chance I could've messed something up in Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
This is generally not supported. Also, only a fraction of the log messages in Quarkus pass through the SLF4J API, so depending on what you're doing, it might not work as well as you expect in practice.
The The role of the You should be able to do anything you need to by implementing one or the other of these, since no information is lost between the log method and the handler (unless the log message is filtered out by configuration).
No, the class loader used is more of an implementation detail and will be addressed by #43749 at some time in the future. |
Beta Was this translation helpful? Give feedback.
-
@dmlloyd
You are absolutely correct. For some reason, I decided that SLF4j's processing of template strings, |
Beta Was this translation helpful? Give feedback.
This is generally not supported. Also, only a fraction of the log messages in Quarkus pass through the SLF4J API, so depending on what you're doing, it mig…