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

**URL:** <https://forum.keycloak.org/t/how-to-enable-acecss-logs-on-keycloak-quarkus-distribution-in-json-format/16333>\
**Category:** Configuring the server\
**Created:** [July 6, 2022, 9:57am UTC](https://forum.keycloak.org/t/how-to-enable-acecss-logs-on-keycloak-quarkus-distribution-in-json-format/16333 "2022-07-06T09:57:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkcmadhu](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/kkcmadhu/32/7545_2.png) [@kkcmadhu](https://forum.keycloak.org/u/kkcmadhu)\
**Post date:** [July 6, 2022, 9:57am UTC](https://forum.keycloak.org/t/how-to-enable-acecss-logs-on-keycloak-quarkus-distribution-in-json-format/16333/1 "2022-07-06T09:57:43Z")

</div>

[Configuring logging - Keycloak](https://www.keycloak.org/server/logging) does not document anything about acecss log configurations.  
[Configuring Keycloak - Keycloak](https://www.keycloak.org/server/configuration#_unsupported_server_options) 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?

---

<div class="post-metadata">

**Author:** ![langnix](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/langnix/32/6379_2.png) [@langnix](https://forum.keycloak.org/u/langnix)\
**Post date:** [August 18, 2022, 6:41am UTC](https://forum.keycloak.org/t/how-to-enable-acecss-logs-on-keycloak-quarkus-distribution-in-json-format/16333/2 "2022-08-18T06:41:05Z")

</div>

Just tried with: /conf/quarkus.properties

```auto
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

```auto
export KC_LOG_CONSOLE_OUTPUT=json

```

---

<div class="post-metadata">

**Author:** ![kkcmadhu](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/kkcmadhu/32/7545_2.png) [@kkcmadhu](https://forum.keycloak.org/u/kkcmadhu)\
**Post date:** [August 18, 2022, 6:58am UTC](https://forum.keycloak.org/t/how-to-enable-acecss-logs-on-keycloak-quarkus-distribution-in-json-format/16333/3 "2022-08-18T06:58:56Z")

</div>

thanks much @langnix.
