Quarkus logging level INFO covers JAVA_OPTS logging.level DEBUG

328 views
Skip to first unread message

Michal W

unread,
Sep 12, 2022, 3:43:03 PM9/12/22
to Keycloak User

In my project since we moved to new keycloak version we started using quarkus as a logging system. When I setup quarkus.logging.level = DEBUG on my kubernetes cluster it's too verbose. What I want to achieve is that my quarkus logging level = INFO but in same time (just for testing some scenarios) I would like to provide to the console logging from my java code. slf4j is what I use in my application to log some info during the flow.

log.debug("Some debug logging information");

I was reading about quarkus categories but non of them fits to slf4j directly. If I set quarkus lvl = INFO and in same time JAVA_OPTS - Dlogging.level ..... =DEBUG it won't work. quarkus covers old kind of properties we were using in past.

Any tip how can I manage that kind scenario?

Michal W

unread,
Sep 19, 2022, 8:29:17 AM9/19/22
to Keycloak User
Basically it is all about overriding quarkus logging level by java_opts logging level. But only partially. 
Any help would be greatly appreciated

Thomas Darimont

unread,
Sep 19, 2022, 9:57:26 AM9/19/22
to Keycloak User
Hello Michal,

you could use a quarkus.properties file to control package specific log levels, e.g.:
- ../../../keycloak/config/quarkus.properties:/opt/keycloak/conf/quarkus.properties:z

quarkus.log.category."com.github.thomasdarimont.keycloak".level=DEBUG


Cheers,
Thomas

Michal W

unread,
Sep 21, 2022, 8:52:26 AM9/21/22
to Keycloak User
Ok, so basically if I'm using SLF4J I suppose to explicitly add mentioned maven dependency
<dependency>
    <groupId>org.jboss.slf4j</groupId>
    <artifactId>slf4j-jboss-logmanager</artifactId>
</dependency>
Next step is to replace all old logging uses with new slf4j-jboss-logmanager. 
Setup quarkus.log.level = INFO as I did previously (for root category) 
and if I want to override only one category for slf4j I need to add 
quarkus.log.category."org.jboss.slf4j".level=DEBUG

One step is not clear for me, the category thing. 
I saw the documentation with long list of default categories (like org.hibernate) etc. 
So the category is actually org.jboss.slf4j it comes from groupId from dependency which is domain name...

Correct me if I'm wrong. 

Regards,
Michal
Reply all
Reply to author
Forward
0 new messages