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
UUID sessionId = InternalSession.SESSION.get().getSession().getSessionId() ?
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()
.