Package Exports
- koa-accesslog
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koa-accesslog) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Accesslog
Output Common Log Format access logs to any stream. Defaults to process.stdout.
Install
# npm ..
npm i koa-accesslog
# yarn ..
yarn add koa-accesslogUsage
const Koa = require('koa');
const accesslog = require('koa-accesslog');
const app = new 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.
const log = new stream.PassThrough();
app.use(accesslog(log));