# How to setup event logging

**URL:** <https://forum.keycloak.org/t/how-to-setup-event-logging/3779>\
**Category:** Configuring the server\
**Created:** [July 14, 2020, 6:56pm UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779 "2020-07-14T18:56:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbreaton1](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mbreaton1/32/1123_2.png) [@mbreaton1](https://forum.keycloak.org/u/mbreaton1)\
**Post date:** [July 14, 2020, 6:56pm UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/1 "2020-07-14T18:56:41Z")

</div>

I have Keycloak setup and running locally as a docker container. I have configured an Identity Provider for handling SAML2 logins.

I am having trouble setting up logging in that the events I set as saved events are not appearing in the logs. I added all the “IDENTITY\_PROVIDER\_\*” events and performed a few logins. The Login Events tab only has a few events (only LOGIN, LOGOUT and CODE\_TO\_TOKEN). I was hoping to view the SAML response packet coming back from the IDP (without having to set the log level to TRACE and view the console).

Am I missing something?

Thanks,

-Mike

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [July 15, 2020, 8:43am UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/2 "2020-07-15T08:43:16Z")

</div>

The event-logging logs “\_ERROR” events at `WARN` level. All other events (aka the “successful” events) are logged with `DEBUG` level. And as default root level is on `INFO`, you don’t see them in the log.

Set the root logging to `DEBUG` or at least the level for `org.keycloak.events` to `DEBUG`, then you should see the events appearing in the log.

---

<div class="post-metadata">

**Author:** ![mbreaton1](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mbreaton1/32/1123_2.png) [@mbreaton1](https://forum.keycloak.org/u/mbreaton1)\
**Post date:** [July 15, 2020, 11:57am UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/3 "2020-07-15T11:57:39Z")

</div>

Thanks for the response. Yes, I have tried that (below is the env vars for the Keycloak container) and do see the logs in console, just not it the UI nor database.

```auto
            - KEYCLOAK_LOGLEVEL=DEBUG
            - ROOT_LOGLEVEL=DEBUG
            - KEYCLOAK_USER=admin
            - KEYCLOAK_PASSWORD=***
            - PROXY_ADDRESS_FORWARDING=true
            - KEYCLOAK_HTTP_PORT=80
            - DB_ADDR=keycloak-data
            - DB_USER=root
            - DB_PASSWORD=***
            - DB_VENDOR=mysql
            - JDBC_PARAMS=useSSL=false

```

We are just looking for a way of viewing the Identity Provider SAML responses (and OIDC eventually) so our support team can coordinate with our SAML customers on setting up their IDPs and helping them to diagnose both error responses and success responses with missing attributes.

We will have tens of thousands of users every hour and logging at this level (and the backing store required for it) is not desirable.

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [July 15, 2020, 6:45pm UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/4 "2020-07-15T18:45:20Z")

</div>

If you set only logging for org.keycloak.events to DEBUG, this won’t yield in massive log sizes and doesn’t impact performance that much.  
But they should also appear in the admin console if you set “save events”. Don’t know why these are not available there. If you have a look into the database, can you see them in the appropriate table?

---

<div class="post-metadata">

**Author:** ![mbreaton1](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mbreaton1/32/1123_2.png) [@mbreaton1](https://forum.keycloak.org/u/mbreaton1)\
**Post date:** [July 15, 2020, 8:01pm UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/5 "2020-07-15T20:01:26Z")

</div>

No, they do not appear in the logs table. That’s why I’m thinking I’m missing something - like a logging listener perhaps - other than `jboss-logging`?

> SELECT \* FROM keycloak.EVENT\_ENTITY where type not in (‘LOGIN’, ‘CLIENT\_LOGIN’, ‘CODE\_TO\_TOKEN’, ‘LOGOUT’);

---

<div class="post-metadata">

**Author:** ![razi.ahmad](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/razi.ahmad/32/3211_2.png) [@razi.ahmad](https://forum.keycloak.org/u/razi.ahmad)\
**Post date:** [July 21, 2021, 11:01am UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/6 "2021-07-21T11:01:16Z")

</div>

How it can be set through CLI?

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [July 21, 2021, 11:15am UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/7 "2021-07-21T11:15:28Z")

</div>

See

> **[Keycloak Events Logging | Niko Köbler - Keycloak Experte, Software-Architekt...](https://www.n-k.de/2020/12/keycloak-events-logging.html)**
>
> There is an update to this article, describing the way event logging will now be configured in Keycloak Quarkus distributions. The rest of this article still remains valid!

and/or

[![](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/2/260cd712799c0f53b203096d397a79c33c2cc700.jpeg "Keycloak Events Logging | Niko Köbler (@dasniko)") ](https://www.youtube.com/watch?v=Rh8LstBPBOE)

---

<div class="post-metadata">

**Author:** ![kbyul07](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@kbyul07](https://forum.keycloak.org/u/kbyul07)\
**Post date:** [February 6, 2024, 12:48pm UTC](https://forum.keycloak.org/t/how-to-setup-event-logging/3779/8 "2024-02-06T12:48:34Z")

</div>

hey there, dumb question, is it possible through helm chart categories?

ty
