Skip to content

Pana/koa-log4js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-log4js

Log4js logger middleware for koa.

Install

npm install koa-log4js

Example

var koa = require('koa');
var logger = require('koa-log4js');


var app = koa();

app.use(logger());  // 使用默认console logger

app.use(function* (){
    this.body = "Hello koa-log4js";
});
app.listen(3000);


// or
app.use(logger({
    "filename": "relative/path/to/log_file.log"
}));



TODO

  • make the options better
  • make the log format configurable

About

log4js logger for koa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published