Reputation: 3
I want to reformat the default logging output to json format without code changes
Docker image: jboss/keycloak:16.1.1
The current log structure is the default
15:04:16,056 INFO [org.infinispan.CLUSTER] (thread-5,null) [Context=authenticationSessions] ISPN100002: Starting rebalance with members [], phase READ_OLD_WRITE_ALL, topology id 2
15:04:16,099 INFO [org.infinispan.CLUSTER] (thread-20,) [Context=offlineClientSessions] ISPN100002: Starting rebalance with members [], phase READ_OLD_WRITE_ALL, topology id 2
I tried to use LOG_CONSOLE_OUTPUT
as described here https://www.keycloak.org/server/logging but it's not working.
Any ideas please?
Upvotes: 0
Views: 800
Reputation: 1912
The link you posted is a tutorial for the Quarkus-based distro. However, your docker image is based on Wildfly.
Here is a Youtube video which explains how to configure json logging with Wildfly-based distro.
Upvotes: 1
Reputation: 2906
Assuming you want to use quarkus based Keycloak: Json logging for the quarkus based keycloak is only available since v18, see the release notes - the guides are at the moment referencing only the latest version.
I heavily recommend to update to this version. Then you could use the log console output variable.
You find the newer container images at quay instead of dockerhub since v17.
Upvotes: 1