Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

koa-accesslog

1.0.0 • Public • Published

Accesslog

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

Install

# npm .. 
npm i koa-accesslog
# yarn .. 
yarn add koa-accesslog

Usage

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));

License

MIT

Install

npm i koa-accesslog

DownloadsWeekly Downloads

94

Version

1.0.0

License

MIT

Unpacked Size

5.24 kB

Total Files

7

Last publish

Collaborators

  • avatar