How to enable acecss logs on keycloak quarkus distribution in json format

Configuring logging - Keycloak does not document anything about acecss log configurations.
Configuring Keycloak - Keycloak do talk about usinng conf/quarkus.properties for native quarkus features… but i am not sure if it will get the logs in json format…

any body has tried access logs in json format so far?

Just tried with: /conf/quarkus.properties

quarkus.http.access-log.enabled=true
quarkus.http.record-request-start-time=true
# see: https://quarkus.io/guides/http-reference#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.pattern
## the prefix "quarkus." is here required also for own properties 
quarkus.pattern.default="%h [%t] \"%r\" %s \"%{i,User-Agent}\" d=%D"
quarkus.pattern.json={ "client":"%{REMOTE_HOST}","method": "%{METHOD}","request_url": %{REQUEST_URL}. "status":"%{RESPONSE_CODE}" , "duration":"%{RESPONSE_TIME}", "bytes":"%{BYTES_SENT}" }
quarkus.http.access-log.pattern=${quarkus.pattern.${KC_LOG_CONSOLE_OUTPUT:default}}

And than call kc.sh with

export KC_LOG_CONSOLE_OUTPUT=json
1 Like

thanks much @langnix.