Nightingale web processor
npm install --save nightingale-web-processor
import Koa from "koa";
import webProcessor from "nightingale-web-processor";
configure([
{
key: "app",
handlers: [new ConsoleHandler(Level.ALL)],
processors: [webProcessor],
},
]);
const app = new Koa();
app.use((ctx, next) => {
ctx.logger = appLogger.context({ request: ctx.req });
return next();
});
app.use(async (ctx) => {
ctx.logger.info("got request !");
ctx.body = "ok";
});