Middleware
The Core Package provide multiple tools to help you to setup an easy to use logger. One on these are Express Middlewares.
ContextMiddleware
This middleware help you to generate and get an unique request ID (UUID).
// Add the middleware to your Express application
app.use(contextMiddleware);
// You can now get the current requestId from everywhere
getRequestContext()?.requestId // string | undefinedLoggerSetupMiddleware
This middleware you find the Controller name based on file naming *.controller.ts
It will also save the responseBody sent to the client.
// Add the middleware to your Express application
app.use(loggerEndpointMiddleware);LoggerEndpointMiddleware
This middleware will log every request received from your API to the Monitor Dashboard
Last updated