Skip to content

Winston middleware logger for Koa based on express-winston.

Notifications You must be signed in to change notification settings

selbyk/koa-logger-winston

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Winston middleware logger for Koa based on express-winston.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%