koa-logger-winston
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/koa-logger-winston package

0.0.2 • Public • Published

koa-logger-winston

Winston middleware logger for Koa based on express-winston.

Forked from winston-koa-logger to implement ES7 async/await functions for Koa2

Instalation

npm i --save koa-logger-winston

Usage

You need to pass a instance of winston to middleware.

const Koa = require('koa');
const logger = require('./logger'); // Winston instance.
const koaLogger = require('koa-logger-winston');
 
const app = new Koa();
 
app.use(koaLogger(logger));
 
app.use(async (ctx, next) => {
  await next();
  ctx.body = 'Hello World';
});
 
app.listen(3000);

Package Sidebar

Install

npm i koa-logger-winston

Weekly Downloads

1,076

Version

0.0.2

License

MIT

Last publish

Collaborators

  • selby