Output Common Log Format access logs to any stream. Defaults to
npm install koa-accesslog
var koa = require('koa'); var accesslog = require('koa-accesslog'); var app = koa(); app.use(accesslog());
127.0.0.1 - - [19/Nov/2014:13:47:37 +0100] "GET / HTTP/1.X" 404 -
You may configure Accesslog to use any writable stream such as an
stream.PassThrough as seen below.
var log = new stream.PassThrough(); app.use(accesslog(log));