Fine tuning class logging for Docker Keycloak

453 views
Skip to first unread message

Mike Shiner

unread,
Oct 18, 2021, 4:58:52 AM10/18/21
to Keycloak User
I am using Keycloak in a docker container (https://hub.docker.com/r/jboss/keycloak/)

I have the logging level set to DEBUG as an environment variable: 
KEYCLOAK_LOGLEVEL=DEBUG

This works great, but there's a few classes which produce a log of DEBUG logs which I would like to switch back to INFO for these two classes only.
Offending classes are:
DEBUG [org.keycloak.transaction.JtaTransactionWrapper]
DEBUG [org.keycloak.services.scheduled.ScheduledTaskRunner]

To set these two classes to INFO, I have placed a file called `log-config.cli` in /opt/jboss/startup-scripts/ which contains the following script:

embed-server --server-config=standalone-ha.xml --std-out=echo
/subsystem=logging/logger=org.keycloak.transaction:write-attribute(name=level,value=INFO)
/subsystem=logging/logger=org.keycloak.services.scheduled:write-attribute(name=level,value=INFO)
stop-embedded-server

However, the container fails to start, with the following error:

"outcome" => "failed",
"failure-description" => "WFLYCTL0216: Management resource '[
(\"subsystem\" => \"logging\"),
(\"logger\" => \"org.keycloak.transaction\")
' not found",
"rolled-back" => true
}

Maybe the subclass isn't a logger - does anyone know change logging for individual classes?

Reply all
Reply to author
Forward
0 new messages