adonis5-logger-middleware
v1.0.1
Published
Adonisjs 5 endpoint logger
Downloads
1
Readme
Adonis5 Logger Middleware
Log endpoint information to revai logger library
{
endpoint: `${ctx.request.method()} - ${ctx.route?.pattern}`,
method: ctx.request.method(),
uri: ctx.route?.pattern,
url: ctx.request.url(),
latency: duration,
status: ctx.response.response.statusCode,
user: ctx.user?.id,
};
Getting started
npm i @revai-care/adonis5-logger-middleware
Add this middleware to kernel.js
Server.middleware.register([
() => import('@revai-care/endpoint_logger') // 👈
]);