@cappalyst/klog

1.0.0 • Public • Published

klog

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

Install

npm install @cappalyst/klog --save

Usage

CommonJS

var Koa = require('koa');
var klog = require('@cappalyst/klog');
var app = new Koa();

app.use(klog());

ES6

import Koa from 'koa'
import klog from '@cappalyst/klog'

const app = new Koa()

app.use(klog())

Output

::1 - - [10/Sep/2018:16:46:58 +0200] "GET / HTTP/1.x" 404 -

Configure

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

var log = new stream.PassThrough();
app.use(klog({ stream: log }));

License

MIT

/@cappalyst/klog/

    Package Sidebar

    Install

    npm i @cappalyst/klog

    Weekly Downloads

    4

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.26 kB

    Total Files

    4

    Last publish

    Collaborators

    • sylver