Skip to content

Carlangueitor/winston-koa-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winston-koa-logger

Winston middleware logger for Koa based on express-winston.

Instalation

npm install winston-koa-logger

Usage

You need to pass a instance of winston to middleware.

const koa = require('koa');
const logger = require('./logger'); // Winston instance.
const winstonKoaLogger = require('winston-koa-logger');

const app = koa();

app.use(winstonKoaLogger(logger));

app.use(function *() {
  this.body = 'Hello World';
});

app.listen(3000);

About

Winston middleware logger for Koa based on express-winston.

Resources

Stars

Watchers

Forks

Packages

No packages published