# Need to log when admin username and password is logging in master realm

**URL:** <https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185>\
**Category:** Getting advice\
**Tags:** admin-console\
**Created:** [February 6, 2020, 6:16pm UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185 "2020-02-06T18:16:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulsrivastava71](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rahulsrivastava71](https://forum.keycloak.org/u/rahulsrivastava71)\
**Post date:** [February 6, 2020, 6:16pm UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185/1 "2020-02-06T18:16:15Z")

</div>

Hello team,  
I need to log whenever someone with admin username and password is logging in the keycloak through UI ,  
for doing that i tried the  
kcadm.sh update events/config -r master -s ‘eventsListeners=[“jboss-logging”]’  
but then also i was not able to see the logs for the same,  
can anyone help that how i can get this log as its very important for us

---

<div class="post-metadata">

**Author:** ![mposolda](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mposolda/32/12_2.png) [@mposolda](https://forum.keycloak.org/u/mposolda)\
**Post date:** [February 7, 2020, 12:57pm UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185/2 "2020-02-07T12:57:03Z")

</div>

You can enable “jboss-logging” listener in the Keycloak admin console.  
If you go to the “Events” tab, it should be possible to enable it. You  
can filter for event types, so you can possibly filter that you are  
interested just in the LOGIN evnets. You can also enable admin events to  
see what exactly that admin user did in the admin console.

Marek

---

<div class="post-metadata">

**Author:** ![rahulsrivastava71](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rahulsrivastava71](https://forum.keycloak.org/u/rahulsrivastava71)\
**Post date:** [February 7, 2020, 1:56pm UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185/3 "2020-02-07T13:56:35Z")

</div>

@mposolda Thanks for your suggestion , is there anyway or rest endpoint to get the events that are registered  
just like this **kcadm.sh get events --offset 0 --limit 100** but this is the admin-cli  
i need the same thing through an api do keycloak provide such kind of api, from where i can get the events

---

<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:** [February 7, 2020, 3:07pm UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185/4 "2020-02-07T15:07:22Z")

</div>

Everything that’s possible via web admin console and kcadm tool, is possible via the Admin REST-API, b/c that’s the base for all of this: [https://www.keycloak.org/docs-api/8.0/rest-api/index.html](https://www.keycloak.org/docs-api/8.0/rest-api/index.html)

Look for `GET /{realm}/events`

---

<div class="post-metadata">

**Author:** ![rahulsrivastava71](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rahulsrivastava71](https://forum.keycloak.org/u/rahulsrivastava71)\
**Post date:** [February 7, 2020, 3:34pm UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185/5 "2020-02-07T15:34:54Z")

</div>

@dasniko i tried(keycloak is hosted on port 8480) [http://localhost:8480/auth/master/events](http://localhost:8480/auth/master/events) to get the master realm events and i am getting 404 not found

 ![Screenshot from 2020-02-07 21-03-03](https://global.discourse-cdn.com/free1/uploads/keycloak/original/1X/048456ad9644150f50ccb827775ff72a83d7628c.png)

and when i hit with the admin-cli i get the result but i need rest endpoint to do this  
i am using keycloak 3.4 version

---

<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:** [February 8, 2020, 8:17am UTC](https://forum.keycloak.org/t/need-to-log-when-admin-username-and-password-is-logging-in-master-realm/1185/6 "2020-02-08T08:17:12Z")

</div>

Just read the docs thoroughly and use the right path: `/auth/admin/realms/{your-realm-name}/events`.  
Then, you’ll need to make this call authenticated with an access\_token, so you need to authenticate yourself first, obtain the token from the token endpoint and use this token in your admin-call.

And last but not least, update your Keycloak version. You’re running a pretty old version…!
