Skip to content

Latest commit

 

History

History

nightingale-web-processor

nightingale-web-processor

Nightingale web processor

Install

npm install --save nightingale-web-processor

Usage

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";
});