How to access middleware RequestID


#1

The link above explains how to set a unique id per request, in the middleware.

//SetLock sets all middleware functionality for the `lock` group
func SetLock(e *echo.Group) {
	// This associates a UUID to each API request that can be useful for tracking purposes
	e.Use(middleware.RequestID())
}

I would like to track that id throughout functions. How can I access that request id?


#2

If you have some more links, can you share with me. I need it and I will try to help you


#3

hey, i am also looking for the same. can anyone help??
thanks in advance!
best regards!!


#4

echo.Context.Response().Header().Get(echo.HeaderXRequestID)


#5

Thank you for the help. Although this guide (https://routerlogin.mobi/192-168-1-7/) also played a prominent role in solving the issue for me!