Skip to content
Middleware for common log format access logs
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test/lib
.gitignore
index.js
package.json
readme.md

readme.md

Accesslog

Output Common Log Format access logs to any stream. Defaults to process.stdout.

Install

npm install koa-accesslog

Usage

var koa = require('koa');
var accesslog = require('koa-accesslog');
var app = koa();

app.use(accesslog());

Output

127.0.0.1 - - [19/Nov/2014:13:47:37 +0100] "GET / HTTP/1.X" 404 -

Configure

You may configure Accesslog to use any writable stream such as an instance of stream.PassThrough as seen below.

var log = new stream.PassThrough();
app.use(accesslog(log));

License

MIT

You can’t perform that action at this time.