# Ignition 8 SDK - how to add MDC key session-id for perspective

**URL:** <https://forum.inductiveautomation.com/t/ignition-8-sdk-how-to-add-mdc-key-session-id-for-perspective/37902>\
**Category:** Module Development\
**Tags:** ignition80\
**Created:** [August 19, 2020, 12:49pm UTC](https://forum.inductiveautomation.com/t/ignition-8-sdk-how-to-add-mdc-key-session-id-for-perspective/37902 "2020-08-19T12:49:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 19, 2020, 12:49pm UTC](https://forum.inductiveautomation.com/t/ignition-8-sdk-how-to-add-mdc-key-session-id-for-perspective/37902/1 "2020-08-19T12:49:08Z")

</div>

In gateway logs there is a MDC key **session-id** with a “short” id  
In a module which depends from **perspective** I would like to known how to add this mdc to the logger or if there is a specific logger class to use

Is it possible to obtain the “short” session-id from the

```auto
UUID sessionId = InternalSession.SESSION.get().getSession().getSessionId() ?

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 19, 2020, 12:58pm UTC](https://forum.inductiveautomation.com/t/ignition-8-sdk-how-to-add-mdc-key-session-id-for-perspective/37902/2 "2020-08-19T12:58:29Z")

</div>

No, the `session-id` key is actually being set on the platform level in the webserver, not by Perspective. You would go to `GatewaySessionManager` on `GatewayContext`, find a session (the ID you’re getting from the `InternalSession` threadlocal should work) - then cast it to a `com.inductiveautomation.ignition.gateway.servlets.GWSession` and call `getPublicId()`.
